The reason is that when you're connecting with a mdb file using the Jet driver, you're actually not dealing with an Access database, but with a Jet Database Engine, and there some minor differences in the SQL. For example, in Access, the Wildcard character
is *, in Jet it is %. Also, you cannot uses a few of the build in functions, Like Replace and Nz. And the list of reserved words is also different:
dabbadavenka...
0 Points
6 Posts
Syntax error in INSERT INTO statement.
May 24, 2012 01:03 PM|LINK
I am getting below error when I tried to execute insert statement against MS Access database.
Syntax error in INSERT INTO statement.
but same statement is executing successfully when I open the mdb file in MS Access.
What could be the reason?
bbcompent1
All-Star
33072 Points
8523 Posts
Moderator
Re: Syntax error in INSERT INTO statement.
May 24, 2012 01:13 PM|LINK
Well, post your code, we can't troubleshoot what we can't see :)
ignatandrei
All-Star
135142 Points
21676 Posts
Moderator
MVP
Re: Syntax error in INSERT INTO statement.
May 24, 2012 01:15 PM|LINK
Help us help you. Show stack trace.
bbcompent1
All-Star
33072 Points
8523 Posts
Moderator
Re: Syntax error in INSERT INTO statement.
May 24, 2012 01:17 PM|LINK
Also, show your connection string because that could also be part of the problem too :)
hans_v
All-Star
35986 Points
6550 Posts
Re: Syntax error in INSERT INTO statement.
May 25, 2012 09:40 AM|LINK
The reason is that when you're connecting with a mdb file using the Jet driver, you're actually not dealing with an Access database, but with a Jet Database Engine, and there some minor differences in the SQL. For example, in Access, the Wildcard character is *, in Jet it is %. Also, you cannot uses a few of the build in functions, Like Replace and Nz. And the list of reserved words is also different:
List of Reserved Words in Access
List of Reserved Words in Jet
You need to show your SQL?