The specified DSN contains an architecture mismatch Error

前端 未结 1 588
忘了有多久
忘了有多久 2020-11-29 12:50

i got this error:

The specified DSN contains an architecture mismatch between the Driver and Application

while trying to conne

相关标签:
1条回答
  • 2020-11-29 13:29

    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

    0 讨论(0)
提交回复
热议问题