0

I have created a application using Java which connect to the MDB file, it writes read and modify data success fully. I have tested it on WIndows 7 32 bit. Now I have shipped every thing on the other machine and created system DNS and all as it was on the earlier machine but the application started to give error for the following query

insert into tblCredentials(NameCode,Password) values(72,'reset123')

Along with that it also started to give error to many INSERT INTO statement which are working on the other machine.

The error I get is

java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Syntax error in
 INSERT INTO statement.
at sun.jdbc.odbc.JdbcOdbc.createSQLException(Unknown Source)
    at sun.jdbc.odbc.JdbcOdbc.standardError(Unknown Source)
    at sun.jdbc.odbc.JdbcOdbc.SQLExecDirect(Unknown Source)
    at sun.jdbc.odbc.JdbcOdbcStatement.execute(Unknown Source)
    at sun.jdbc.odbc.JdbcOdbcStatement.executeUpdate(Unknown Source)
    at timesheetserver.MDBHandler.executeUpdateQuery(MDBHandler.java:99)

I cant find anything wrong in it and moreover it is working on one of my WIndows & machine.

What can be the problem Thanks in advance

11
  • @TheNewIdiot As I have mentioned in the post Error is :Syntax Error in the INSERT INTO statement Commented May 29, 2013 at 9:43
  • Paste the full sql error please . Commented May 29, 2013 at 9:45
  • @TheNewIdiot Added complete stack trace Commented May 29, 2013 at 9:57
  • Do you have the table script for tblCredentials? What if your NameCode is alphanumeric? In that case you would need the '' in the query. Maybe you have a datatype mismatch on both machines. Commented May 29, 2013 at 10:50
  • 1
    According to this page, it is: office.microsoft.com/en-us/access-help/… Have you tried using identifier quotes with your NameCode and Password fields? Maybe you have different Access or ODBC Driver versions which react differently with such an issue... Commented May 29, 2013 at 11:20

1 Answer 1

0

According to this page, PASSWORD is a reserved word for Access: office.microsoft.com/en-us/access-help/…

Have you tried using identifier quotes with your NameCode and Password fields?

Maybe you have different Access or ODBC Driver versions which react differently with such an issue...

Sign up to request clarification or add additional context in comments.

1 Comment

I would like to add a point here. This is a case only when you are using the ExtendedAnsiSQL support . If you dont require this support then simply set ExtendedAnsiSQL to 0 while creating the System DNS

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.