...

View Full Version : INSERT INTO troubles... please help!



jaywhy13
12-27-2004, 07:31 PM
:o Can some one give at shot explaining to me the reason why the following works:
msgCreate="INSERT INTO userMessages (messageID, message, header, category) VALUES "
msgCreate=msgCreate & "('" & msgid & "','" & themessage & "','" & thesubject & "','" & thetype & "')"
Conn.execute msgCreate

:mad:


But this gives me an error: :eek:
msgCreate="INSERT INTO userMessages (messageID, message, header, category, from) VALUES "
msgCreate=msgCreate & "('" & msgid & "','" & themessage & "','" & thesubject & "','" & thetype & "','" & msgsentby & "')"
Conn.execute msgCreate

==========================================================

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

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

/thegroupgenesis/final draft/msgcompose.asp, line 94


line 94 is the Conn.execute msgCreate line


Once I try putting in the from field, which DOES exist in the table it spits that error.!!!! :mad: :mad: :mad: :mad: :mad:

oracleguy
12-27-2004, 08:02 PM
"from" is a reserved word, if you are going to use it, you need to put brackets around it like so: [from].

jaywhy13
12-27-2004, 08:39 PM
Worked like a charm!!!! Thanks alot man!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum