View Full Version : Insert Into Synatx error

08-21-2006, 04:39 PM
I just know im makeing a stupid mistake but no matter what i try (reserverd words and such) i have no luck debuging this one line of code:

set Exe = oConn.Execute("INSERT INTO sales_reps SET (username, vpassword, first_name, last_name, address, city, vstate, zip, home_phone, cell_phone, email, location_tag, ses_number) VALUES ('"& username &"', '"& password &"', '"& first_name &"', '"& last_name &"', '"& Address &"', '"& vCity &"', '"& vState &"', '"& Zip &"', '"& HomePhone &"', '"& CellPhone &"', '"& Email &"', '"& LocationTag &"', '"& SESNumber &"')")

the error it returns is a syntax error:

Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

[Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement.

/testindc/sunrise/save_new_rep.asp, line 31

all names were copied and pasted form the originals. if anyone sees my mistake any help would be greatly apprecieated.

08-21-2006, 04:42 PM
The word SET does not belong in an INSERT statement. that is throwing your error.

note, when posting code please use [ code] and [/code] tags around your code. without the space in the first tag.

you should also mention that you are using COLDFUSION or whatever application if you are using the code above because it won't be inserted into mysql directly with those & symbols in your values.

08-21-2006, 04:52 PM
Thanks. sry about the formating stuff. i knew it had to be something like that. just sliped my eye.