I have 64 bit eclipse and configured this with 64bit jvm when i try to connect MS Access (32 bit MS office) it gives me error

Exception: [Microsoft][ODBC Driver Manager] 
The specified DSN contains an architecture mismatch between 
the Driver and Application

I also defined DSN in c:\windows\sysWOW64\odbcad32.exe in my Win 7 64 bit machine and Even tried by both 32 bit and 64 bit jvm but everytime i got the same error but when i run the same code with 32 bit Eclipse its working fine, but i have to run with 64 bit Eclipse, Please help

2

There are 2 answers

0
Luke Woodward On

Try using UCanAccess instead of the JDBC-ODBC bridge driver.

UCanAccess is pure Java, so there shouldn't be any 32-bit/64-bit issues talking to an Access database with it. Besides, the JDBC-ODBC bridge driver is no longer included in Java 8, so you'll have to migrate away from it if you want your application to run on Java 8.

This answer contains instructions on how to set up Eclipse to use it.

1
Mark Rotteveel On

You can only use a 32 bit ODBC driver from a 32 bit application. You either need 64 bit Access ODBC driver (which is not possible if you have 32 bit office iirc), or you need to switch to 32 bit Java/Eclipse.

Otherwise, look at the answer by Luke Woodward to use UCanAccess.