Cannot Connect to MS Access Database via JDBC on Win 7 64-bit

I am trying to connect to an MS Access 2007 database through JDBC. My JDK is the 64-bit version of JDK 1.6u18, and the OS is 64-bit Windows 7. But the problem is that I cannot create a DSN using Windows\system32\odbcad32.exeit because it does not show ODBC drivers for MS Access at all, it only shows drivers for MS SQL Server.

When you try to click "Configure" for "MS Access Database" (this is a DSN already created, I think), the error message first appears: "Installation procedures for Microsoft Access drivers (* .mdb, * .accdb) Could not find the ODBC driver. Reinstall the driver. And another message: "Errors found! The specified DSN contains an architecture mismatch between the Driver and the Application. "

I cannot reinstall MDAC because it does not work with Windows 7 (which comes with its own WDAC).

odbcad32.exe Windows\SysWOW64allows me to create a DSN for MS Access, it shows that the drivers are installed correctly. However, when I try to connect to this 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)

, ? , JDK - 64-. Access 2007, , , 32-? . , , , . , , .

- JDBC- MS Access. , .: -/

PS: , , MS Access .

+3
4

, , .

ODBC, 32- odbcad32.exe, c:\windows\sysWOW64\odbcad32.exe, . : http://msdn.microsoft.com/en-us/library/ms712362%28v=vs.85%29.aspx

, , , .

, , 32- , , 32- JVM. , 32- JRE 6U26, .

, .

+1

JDBC Windows 7, , Java 64, , , 32 . Java 6 32- JVM, . , 32- MS Access, .

+1

jvm 64 , 64- ODBC. 64- odbc, , . ...

0

Source: https://habr.com/ru/post/1734613/


All Articles