7

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?

Charles
  • 50,943
  • 13
  • 104
  • 142
Jack BeNimble
  • 35,733
  • 41
  • 130
  • 213
  • There is a free 64 bit driver for MS Access, would that suit? http://www.microsoft.com/en-us/download/details.aspx?id=13255 – Fionnuala Aug 31 '12 at 18:43
  • I just read up on it, but the users are saying it's buggy. – Jack BeNimble Aug 31 '12 at 18:48
  • Which users? It is two years old at this stage and and the 2013 version is on the way. I would imagine that any comments on buggy-ness are from the past. – Fionnuala Aug 31 '12 at 18:51
  • 1
    The link you provide says it's for exchanging data for office 2010 apps, but I'm running 2007. It also says it's a distribution of the Jet engine - I'm not sure what impact that would have on my existing Access install. – Jack BeNimble Aug 31 '12 at 18:57
  • @Remou Wrong suggestion - that 64 bits drivers could be installed ONLY if Office 64 bit is previously installed on the system – Nenad Bulatović Jun 03 '14 at 17:10

1 Answers1

3

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.

Peter Lawrey
  • 525,659
  • 79
  • 751
  • 1,130
  • 1
    As I suspected, in the end I just installed the 32-bit version of STS and Java and now it works. I did try changing STS.ini on the 64-bit version to point to the 32-bit JDK, but it didn't work. – Jack BeNimble Aug 31 '12 at 19:42
  • @PeterLawrey:I never understood this.You can use a 32-bit dll in a 64-bit PC but you can't use it with a 64-bit JVM.But how come? – Cratylus Aug 31 '12 at 21:33
  • 2
    In a 64-bit OS, you can run either a pure 64-bit program or a pure 32-bit program. One of the reasons for this is that your pointer sizes need to match. Say you have a 64-pointer and you call a library which has been compiled for 32-bit pointers, there is no way for the library to accept this pointer. Similarly, if you have 64-bit library it cannot return a 64-bit pointer back to a 32-bit application. The OS can allow you to run either bitness by having two sets of system libraries you can call, one 32-bit and one 64-bit. – Peter Lawrey Sep 01 '12 at 06:47
  • 1
    The reason you can run either of two sizes is that the OS provides two versions of the system libraries, one 32-bit and one 64-bit. – Peter Lawrey Sep 01 '12 at 06:50
  • @PeterLawrey:Ah!Thank you for explaining this! (+1) – Cratylus Sep 01 '12 at 09:29