2

On Windows 7 64 bit machine, with Eclipse Kepler 64 bit, JDK6, I have this error:

SQL Error: java.sql.SQLException: [Microsoft][ODBC Driver Manager] The specified DSN contains an architecture mismatch between the Driver and Application 0 IM014

This Q&A unfortunately didn't help me: https://stackoverflow.com/questions/6721702/windows-7-64-bit-odbc-drivers-for-ms-access-missing

"Target" was set to: %windir%\System32\odbcad32.exe and "Start in" was set to: %windir%\System32

so, I changed it to: "Target" to: %windir%\SysWOW64\odbcad32.exe and "Start in" was set %windir%\SysWOW64 and later to %windir%\System32 - didn't work neither way.

I also had a look at this but the answer is not satisfying (installing 32 bit version of Java and STS) 64-bit Java can't access 32-bit MS Access database via ODBC

I tried to put the argument "-D32" in the VM arguments, but didn't help either.

Neither this one: Is there a Windows 7 ODBC driver for Access?

I read this as well: http://msdn.microsoft.com/en-us/library/ms712362(v=vs.85).aspx

and this http://social.msdn.microsoft.com/Forums/vstudio/en-US/097ff93d-20be-41ed-b318-dc51cca0b811/the-specified-dsn-contains-an-architecture-mismatch-between-the-driver-and-application?forum=wcf

but those are instructions for Visual Studio, in Eclipse KEPLER for Java SE, I don't know where to find options they suggest (compiling options x86 vs. x64)

Trying to use this architecture mismatch between the Driver and Application? without success. When I try to install 64 bit drivers it complains that I use 32 bit Office and therefore those drivers can't be installed. I installed 2007 Office System Driver: Data Connectivity Components but I gained nothing that previously weren't on system already http://www.microsoft.com/en-us/download/confirmation.aspx?id=23734

I also read this one: http://social.technet.microsoft.com/Forums/sqlserver/en-US/a4ddb239-64d8-4074-978c-45c30381c107/ssrs-2012-error-im014-microsoftodbc-driver-manager-the-specified-dsn-contains-an-architecture?forum=sqlreportingservices

If I understood it properly, as I am using Windows 7 64 bit, with Eclipse Kepler 64 bit, JDK6, and Office Access 2007, I believe I should be using this:

Quote: To manage a data source that connects to a 32-bit driver under 64-bit platform, we use C:\Windows\SysWOW64\odbcad32.exe

What should I do in order to make it work (besides to install 32 bit Eclipse and 32 bit JVM as OP finally did here (64-bit Java can't access 32-bit MS Access database via ODBC)

Community
  • 1
  • 1
Nenad Bulatović
  • 7,238
  • 14
  • 83
  • 113
  • What version of Access do you have installed? – Elliott Frisch Jun 03 '14 at 18:21
  • @ElliottFrisch Access 2007 32 bit, whole Office (that I have) is 32 bit. If I had 64 bit, I could (probably) download 64 bit drivers for Office 2010 (http://www.microsoft.com/en-us/download/details.aspx?id=13255) – Nenad Bulatović Jun 03 '14 at 18:38
  • This advice may not help, but don't use Access. MySQL, PostgreSQL or even SQL Server would avoid this native code issue. Otherwise, you're stuck with a 32-bit java (which you can use as a temporary solution, or not). – Elliott Frisch Jun 03 '14 at 18:40
  • @ElliottFrisch I totally agree, but I follow a tutorial from book with accompanying code and Access database. I mean it is not like I MUST use this (especially because I am familiar with Oracle SQL), it's just that I paid for the book and I want to work out every single example (in this case whole chapter) from it. BTW I set it as temporary solution 32 bit JDK & Eclipse and of course it works. – Nenad Bulatović Jun 03 '14 at 18:45

2 Answers2

1

You can use a 32-bit JRE in a 64 bit eclipse,

goto "Window > Preferences > Java > Installed JREs", then click "Add"

Then use this new 32-bit JRE a the target runtime for your "Access" project (under "run configuration").

Elliott Frisch
  • 198,278
  • 20
  • 158
  • 249
0

This should be the complete "solution" for this problem:

  • Control Panel --> Administrative Tools --> Right Click then Properties then Shortcut tab, set "Target" to %windir%\SysWOW64\odbcad32.exe and set "Start in" to %windir%\System32
  • Download and install 32 bit JDK

Do what Elliot Frisch says:

  • Go to "Window > Preferences > Java > Installed JREs", then click "Add"
  • Then use this new 32-bit JRE a the target runtime for your "Access" project (under "run configuration").

And that's it.

Nenad Bulatović
  • 7,238
  • 14
  • 83
  • 113