Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Microsoft SQL Native Client error '80040e14'

Status
Not open for further replies.

anon1971

Programmer
Aug 9, 2008
88
0
0
US
I am getting this error adn I just can't figure out why.


'The Error

Microsoft SQL Native Client error '80040e14'

Incorrect syntax near the keyword 'User'.

/apps/cs/login/edit/update.asp, line 226



'The Code the error is coming from.

ProjectID=session("ID")
Subject="Account Update"
Note=Trim(Request.Form("office_comment"))
NoteDate=Now
Complete="-1"
Followup=Date
User="WEB"


sql = "INSERT INTO NotesD (ProjectID, Subject, Note, NoteDate, Complete, Followup, User)" & _
"VALUES ('"& ProjectID & "','" & Subject & "','" & Note & "','" & NoteDate & "','" & Complete & "','" & Followup & "','" & User & "')"
conn.execute sql, , 129
 
user is a reserved word. You should try to avoid using a reserved word for your column names, but when you can't avoid it, you can use square brackets to get the query to work. Like this...

Code:
sql = "INSERT INTO NotesD (ProjectID, Subject, Note, NoteDate, Complete, Followup, [!][[/!]User[!]][/!])" & _

-George

"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
Got it and the funny thin gis the name in the sql database had square bracets lol
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top