Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

64-bit Java can't access 32-bit MS Access database via ODBC

I've got a new 64-bit laptop and have installed STS 64-bit and Java 64-bit. I'm trying to create an ODBC connection to a 32-bi Microsoft database; however the default Admin tools don't provide a driver for access. After googling around, I saw that there's an admin tool for creating 32-bit drivers located in C:\Windows\SysWOW64\odbcad32.exe. However, an ODBC connection created from that that gives me an error message indicating an architecture mismatch when I run the program:

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

I think it's because the 64-bit Java is trying to use the 32-bit driver. To get around the problem, I tried to put the argument "-D32" in the VM arguments, but got the same result.

I'm thinking of uninstalling STS and Java and replacing them with the 32 bit versions. Is there a better solution?

like image 982
Jack BeNimble Avatar asked Aug 31 '12 18:08

Jack BeNimble


1 Answers

To load a 32-bit native library you need to have a 32-bit JVM.

You don't need to uninstall Java, you can have as many version installed as you like.

You can use your 64-bit JVM to talk to a 32-bit JVM which loads your driver, but this may be more complicated than you need.

like image 172
Peter Lawrey Avatar answered Oct 03 '22 10:10

Peter Lawrey