473,408 Members | 1,762 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

You have an error in your SQL syntax;

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.
Nov 24 '07 #1
1 2609
amitpatel66
2,367 Expert 2GB
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.
Try printing this variable query2 and check for single quotes and otehr syntax in the query which will help u find the error!!

If the error is raised, then def yur query will be syntatically incorrect elso system will not raise error just like that!!
Nov 25 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Steve | last post by:
I just spent waaaaaaaaaaaayy too much time trying to track down an error that was incorrectly reported just now, and I would like to see if someone can explain to me why it was reported that way. ...
29
by: shank | last post by:
1) I'm getting this error: Syntax error (missing operator) in query expression on the below statement. Can I get some advice. 2) I searched ASPFAQ and came up blank. Where can find the "rules"...
0
by: Morten Gulbrandsen | last post by:
C:\mysql\bin>mysql -u elmasri -pnavathe company Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 29 to server version: 4.1.0-alpha-max-debug Type...
0
by: Shashikiran Prabhakar via .NET 247 | last post by:
(Type your message here) Hi, I am not very conversent in VC++, but the requirement for me is to run a rendering code. However i am encountering the following errors. c:\Program...
5
by: r.nikhilk | last post by:
Hi, Currently, we are porting C++ applications from 32 bit to 64 bit on AIX platform. (The current version of AIX is 5.3 and xlC verison is 8.0). We are able to compile the applications by...
2
by: david | last post by:
Anyone could give me a hand about this syntax error? Thank you. David Source Code: Dim conn As New SqlConnection(strConn) Dim daAngio As New SqlDataAdapter(strSelectStatement, conn) 'Create a...
3
by: Manuel | last post by:
I'm trying to compile glut 3.7.6 (dowbloaded from official site)using devc++. So I've imported the glut32.dsp into devc++, included manually some headers, and start to compile. It return a very...
21
by: Ram Prasad | last post by:
I am trying to write a simple libspf2 plugin code for my postfix ( milter) I am getting this unhelpful error message when I try to compile gcc -g1 -Wall -I/usr/local/include/spf2 -I. -c mfunc.c...
25
by: notahipee | last post by:
I have been trying to cin an number from 0 to 9 with a leading 0. For example 00 or 07. I was using a switch case. switch (int) { case 01: break; case 02: break;..... My problem arises at 08...
15
by: madhu.ab | last post by:
Hi All, I am getting the following errors when i am including header file winuser.h I dont know whats happening. How will an error occur in winuser.h?? Please help. \microsoft visual...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.