From: Ninad on
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. :-/
From: Sylvain Lafontaine on
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" <Ninad(a)discussions.microsoft.com> wrote in message
news:30EDEC30-CF38-40B4-AC4A-BA8A9250F9A2(a)microsoft.com...
> 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. :-/