scouse
06-29-2005, 05:36 AM
Hi,
I have done Insert statements many times before and never have a problem, but for some reason I've tried it this time and its coming up with an error.
I reckon I've just made a silly mistake in the syntax, but I've been staring at it for so long now that I can't find the mistake. :rolleyes:
Could someone just have a look at the following bit of code and let me know if there is something obvious which is stopping it from working:
sqlPAGE="INSERT INTO mess(FROM, TO, SUBJECT, MESSAGE, LINK, DATE, ARCHIVE) VALUES('"&strFROM&"', '"&strTO&"', '"&strSUBJECT&"', '"&strMESSAGE&"', '"&strLINK&"','"&strDATE&"', '"&strARCHIVE&"')"
objConn.Execute(sqlPAGE)
This is the error that it is generating
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[MySQL][ODBC 3.51 Driver][mysqld-4.1.8-nt]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM, TO, SUBJECT, MESSAGE, LINK, DATE, ARCHIVE) VALUES('HOLLY', 'PHIL', '1', '1' at line 1
Any help would be appreciated.
Thanks
Phil
I have done Insert statements many times before and never have a problem, but for some reason I've tried it this time and its coming up with an error.
I reckon I've just made a silly mistake in the syntax, but I've been staring at it for so long now that I can't find the mistake. :rolleyes:
Could someone just have a look at the following bit of code and let me know if there is something obvious which is stopping it from working:
sqlPAGE="INSERT INTO mess(FROM, TO, SUBJECT, MESSAGE, LINK, DATE, ARCHIVE) VALUES('"&strFROM&"', '"&strTO&"', '"&strSUBJECT&"', '"&strMESSAGE&"', '"&strLINK&"','"&strDATE&"', '"&strARCHIVE&"')"
objConn.Execute(sqlPAGE)
This is the error that it is generating
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[MySQL][ODBC 3.51 Driver][mysqld-4.1.8-nt]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM, TO, SUBJECT, MESSAGE, LINK, DATE, ARCHIVE) VALUES('HOLLY', 'PHIL', '1', '1' at line 1
Any help would be appreciated.
Thanks
Phil