The specified DSN contains an architecture mismatch Error

That message appears under the following circumstances:

  • you have the Access Database Engine (a.k.a. “ACE”) installed,
  • you create an ODBC DSN for your database connection, and
  • your Java code is running in a JVM (Java Virtual Machine) whose “bit-ness” is different than that of the installed version of ACE.

For example,

  1. you could have the 32-bit version of ACE installed and be trying to connect from Java code running in a 64-bit JVM, or

  2. you could have the 64-bit version of ACE installed and be trying to connect from Java code running in a 32-bit JVM.

If you really want to use the JDBC-ODBC Bridge then the solution is to either switch to the “other” version of ACE (i.e., switch from 32-bit to 64-bit or vice versa), or have your Java code run under a JVM with the same “bit-ness” as the installed version of ACE.

(Note that if you have Office installed then “switching to 64-bit ACE” really means “switching to 64-bit Office”. You can’t “mix and match” 32-bit and 64-bit Office components.)

However, now that the JDBC-ODBC Bridge has been removed from Java 8 you should consider using the UCanAccess JDBC driver instead. It is a pure Java implementation that does not use Access ODBC to manipulate the database, so it works under both 32-bit and 64-bit JVMs on all platforms that run Java (i.e., not just Windows). For more details, see

Manipulating an Access database from Java without ODBC

Leave a Comment