Cannot find ODBC driver for MS Access 2007 database on Win 7 64-bi

N

Ninad

Hello.

I've been trying to connect to a MS Access 2007 database through JDBC. My
JDK is JDK 1.6u18 64-bit and OS is Windows 7 64-bit. But problem is I am
unable to create a DSN using Windows\system32\odbcad32.exe because it doesn't
show ODBC drivers for MS Access at all, it's only showing drivers for MS SQL
Server.

When tried to click on Configure for "MS Access Database" (which is an
already created DSN, I guess), it first shows error message : "The setup
routines for the Microsoft Access Drivers (*.mdb, *.accdb) ODBC Driver could
not be found. Please reinstall the driver."
And then another message : "Errors found! The specified DSN contains an
architecture mismatch between the Driver and Application."

I cannot reinstall the MDAC as it doesn't work with Windows 7 (which comes
with its own WDAC).

The odbcad32.exe in Windows\SysWOW64 does let me create a DSN for MS Access,
it shows the drivers installed properly. However, when tried to connect to
that DSN through a Java program, I get the following exception :

java.sql.SQLException: [Microsoft][ODBC Driver Manager] The specified
DSN contains
an architecture mismatch between the Driver and Application
at sun.jdbc.odbc.JdbcOdbc.createSQLException(Unknown Source)
at sun.jdbc.odbc.JdbcOdbc.standardError(Unknown Source)
at sun.jdbc.odbc.JdbcOdbc.SQLDriverConnect(Unknown Source)
at sun.jdbc.odbc.JdbcOdbcConnection.initialize(Unknown Source)
at sun.jdbc.odbc.JdbcOdbcDriver.connect(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at AccessTest.main(AccessTest.java:19)

What might be the problem and what do I have to do to get it working? My OS
as well as JDK are 64-bit. Can't I connect to a Access 2007 database, which I
presume is 32-bit? Any help would be highly appreciated.

Another option would be to find a third-party JDBC driver for MS Access. But
I do need to know what's wrong with my configuration. :-/
 
S

Stefan Hoffmann

hi,

The odbcad32.exe in Windows\SysWOW64 does let me create a DSN for MS Access,
it shows the drivers installed properly. However, when tried to connect to
that DSN through a Java program, I get the following exception :
This creates a DSN using the 32-bit Jet driver.
What might be the problem and what do I have to do to get it working? My OS
as well as JDK are 64-bit. Can't I connect to a Access 2007 database, which I
presume is 32-bit? Any help would be highly appreciated.
I assume that JDBC cannot bridge between its 64-bit and the 32-bit driver.

You should really ask such a question in some Java groups.

mfG
--> stefan <--
 
S

Sylvain Lafontaine

Nothing wrong with your configuration. At this moment, there is not
official 64 bit ODBC driver for Access; this means that you cannot open an
Access database from any program running under the 64 bit world (only from
the emulated 32 bit world (or WOW64, Windows 32 bit On Windows 64 bit)).

From what I've heard, there is one 64 bit driver available with the latest
Beta of Office 2010. However, you cannot use this 64 bit ODBC driver for
Access at the same time as any 32 bit driver for Access; which means that
you will have to chose between one or the other.

--
Sylvain Lafontaine, ing.
MVP - Windows Live Platform
Blog/web site: http://coding-paparazzi.sylvainlafontaine.com
Independent consultant and remote programming for Access and SQL-Server
(French)


Ninad said:
Hello.

I've been trying to connect to a MS Access 2007 database through JDBC. My
JDK is JDK 1.6u18 64-bit and OS is Windows 7 64-bit. But problem is I am
unable to create a DSN using Windows\system32\odbcad32.exe because it
doesn't
show ODBC drivers for MS Access at all, it's only showing drivers for MS
SQL
Server.

When tried to click on Configure for "MS Access Database" (which is an
already created DSN, I guess), it first shows error message : "The setup
routines for the Microsoft Access Drivers (*.mdb, *.accdb) ODBC Driver
could
not be found. Please reinstall the driver."
And then another message : "Errors found! The specified DSN contains an
architecture mismatch between the Driver and Application."

I cannot reinstall the MDAC as it doesn't work with Windows 7 (which comes
with its own WDAC).

The odbcad32.exe in Windows\SysWOW64 does let me create a DSN for MS
Access,
it shows the drivers installed properly. However, when tried to connect to
that DSN through a Java program, I get the following exception :

java.sql.SQLException: [Microsoft][ODBC Driver Manager] The specified
DSN contains
an architecture mismatch between the Driver and Application
at sun.jdbc.odbc.JdbcOdbc.createSQLException(Unknown
Source)
at sun.jdbc.odbc.JdbcOdbc.standardError(Unknown Source)
at sun.jdbc.odbc.JdbcOdbc.SQLDriverConnect(Unknown Source)
at sun.jdbc.odbc.JdbcOdbcConnection.initialize(Unknown
Source)
at sun.jdbc.odbc.JdbcOdbcDriver.connect(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at AccessTest.main(AccessTest.java:19)

What might be the problem and what do I have to do to get it working? My
OS
as well as JDK are 64-bit. Can't I connect to a Access 2007 database,
which I
presume is 32-bit? Any help would be highly appreciated.

Another option would be to find a third-party JDBC driver for MS Access.
But
I do need to know what's wrong with my configuration. :-/
 
N

Ninad

Stefan Hoffmann said:
hi,


This creates a DSN using the 32-bit Jet driver.

I assume that JDBC cannot bridge between its 64-bit and the 32-bit driver.

You should really ask such a question in some Java groups.

mfG
--> stefan <--
.

Thanks for your reply Stefan, but I really doubt it's a Java- related issue.
I am unable to create a DSN in the first place, using Microsoft's own ODBC
wizard. It is showing my drivers are corrupted & there is an "architecture
mismatch".
 
N

Ninad

Sylvain Lafontaine said:
Nothing wrong with your configuration. At this moment, there is not
official 64 bit ODBC driver for Access; this means that you cannot open an
Access database from any program running under the 64 bit world (only from
the emulated 32 bit world (or WOW64, Windows 32 bit On Windows 64 bit)).

From what I've heard, there is one 64 bit driver available with the latest
Beta of Office 2010. However, you cannot use this 64 bit ODBC driver for
Access at the same time as any 32 bit driver for Access; which means that
you will have to chose between one or the other.

I would be fine with 32-bit drivers for MS Access, but looks like my system
doesn't support 32-bit driver at all, it's showing "architecture mismatch".
And I don't know how do I accept this, because it's not "unusual" to use
64-bit systems & software these days, I always thought they are
back-compatible with their 32-bit counterparts. I have never encountered any
such incompatibility except for Access.

I have decided to try out with a 32-bit JDK (though I really doubt it'll
solve my problem). Only other option is to use Windows XP mode and use
everything 32-bit. Which means I'll have to upgrade my Windows 7 edition. Or
to use MS Access 2010 which is still Beta.
 
D

Douglas J. Steele

Ninad said:
Thanks for your reply Stefan, but I really doubt it's a Java- related
issue.
I am unable to create a DSN in the first place, using Microsoft's own ODBC
wizard. It is showing my drivers are corrupted & there is an "architecture
mismatch".

There is no 64 bit driver for Access 2007. You have no choice but to use the
32 bit driver, even if you're running a 64 bit operating system. Most
applications are capable of communicating with 32 bit drivers from a 64 bit
operating system: that's the piece you need to find out how to do with Java.
 
N

Ninad

Douglas J. Steele said:
There is no 64 bit driver for Access 2007. You have no choice but to use the
32 bit driver, even if you're running a 64 bit operating system. Most
applications are capable of communicating with 32 bit drivers from a 64 bit
operating system: that's the piece you need to find out how to do with Java.

I am sorry if I am being too dumb, but what do I do if I can't create a DSN
for MS Access 2007 database using ODBC Data Source Administrator which says
my driver for MS Access is corrupted and that the reason behind it is an
architecture mismatch? And in such case, how is Java supposed to deal with
it? I think it first needs an ODBC driver to start with.

I am willing to use a 32-bit driver as I have said in my post in reply to
Sylvain, it's just that my system isn't ready to accept a 32-bit driver.

Please, please clarify where I am going wrong.
 
S

Stefan Hoffmann

S

Sylvain Lafontaine

You cannot use a 32 bit driver from a 64 bit program - this is your
"architecture mismatch" problem and yes, using a 32 bit JDK should solve it.

--
Sylvain Lafontaine, ing.
MVP - Windows Live Platform
Blog/web site: http://coding-paparazzi.sylvainlafontaine.com
Independent consultant and remote programming for Access and SQL-Server
(French)
 
J

joelgeraldine

rtyuiooo

Ninad said:
Thanks for your reply Stefan, but I really doubt it's a Java- related
issue.
I am unable to create a DSN in the first place, using Microsoft's own ODBC
wizard. It is showing my drivers are corrupted & there is an "architecture
mismatch".
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top