You have an error in your SQL syntax
Posted on 2007-11-24
I moved my database from Access to MySQL. I then installed ODBC 3.51 driver for MySQL.
I'm getting the following error:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[MySQL][ODBC 3.51 Driver][mysqld-5.0.45-community-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 '[Student Number] = 'Student Number' AND Not [Student Number] = '') OR ([Student ' at line 1
/aspDump/uploader.asp, line 173
The query its referring to is:
query2 = "SELECT * FROM webctgrades WHERE (([Student Number] = '" & records(3) & "' AND Not [Student Number] = '') OR ([Student ID] = '" & records(2) & "' AND NOT [Student ID] = '')) And Record = '2' And [Course Number] = '" & courseNum & "'"
I've checked the fieldnames and table name and all appear to be identical.
Any help would be seriously appreciated.