Why do I get error "esdbcapi.dll: Can't load AMD 64-bit .dll on a IA 32-bit platform"?

You're attempting to use a 64-bit JDBC-Access Gateway DLL with a 32-bit Java Virtual Machine JVM.

The JDBC-Access Gateway has a Java component (esmdb.jar) and a native Windows component (esdbcapi.dll). On 64-bit Windows, the JDBC-Access Gateway distribution includes both a 32-bit and a 64-bit version of esdbcapi.dll. On this platform, the JDBC-Access Gateway Setup program configures your environment so that the 64-bit version of esdbcapi.dll is loaded by default. This is the correct DLL if you're using a 64-bit JVM.

If you're using a 32-bit JVM, you need to configure your Path so that Windows loads the 32-bit version of esdbcapi.dll, which by default is stored in drive:\Program Files\Easysoft Limited\Easysoft JDBC-Access Gateway\32-Bits\Libs.

In the following example, ConnectToAccess fails because it's being used with a 32-bit version of Java and Windows is loading a 64-bit version of esdbcapi.dll:

C:\MyJavaApps> java ConnectToAccess
JDBC Driver Information
Driver name: easysoft.sql.esMdbDriver
Driver Major Version: 1
Driver Minor Version: 0
Exception in thread "main" java.lang.UnsatisfiedLinkError:
C:\Program Files\Easysoft Limited\Easysoft JDBC-Access Gateway\Libs\esdbcapi.dll:
Can't load AMD 64-bit .dll on a IA 32-bit platform

Updating the Path environment variable causes Windows to load the 32-bit version of esdbcapi.dll:

C:\MyJavaApps>SET PATH=C:\Program Files\Easysoft Limited\Easysoft JDBC-Access Gateway\32-Bits\Libs;%PATH%
C:\MyJavaApps>ConnectToAccess
JDBC Driver Information
Driver name: easysoft.sql.esMdbDriver
Driver Major Version: 1
Driver Minor Version: 0
JDBC Major Version: 1

If you use the JDBC-Access Gateway with a 64-bit JVM, the Gateway uses the Access ODBC driver (aceodbc.dll) as its native library. aceodbc.dll is distributed with Office 2007+ and is also available to download from Microsoft's web site. aceodbc.dll supports both MDB and ACCDB format Access database files.

If you use the JDBC-Access Gateway with a 32-bit JVM, the Gateway uses the Microsoft ODBC Desktop Database Drivers (odbcjt32.dll) as its native library. odbcjt32.dll is distributed with Windows and supports both MDB format Access database files.