指定的DSN包含体系结构不匹配错误 [英] The specified DSN contains an architecture mismatch Error

查看:248
本文介绍了指定的DSN包含体系结构不匹配错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到此错误:


指定的DSN包含Driver
和Application

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

尝试使用NetBeans和Java编程语言连接数据库时

while trying to connect to the database using NetBeans and Java Programming Language

我正在使用Microsoft Access 2010和我的系统在64位Windows 7下运行。

I am using Microsoft Access 2010 and my system running at 64bit Windows 7.

如何解决此问题?谢谢大家。

How do i solve this problem? Thanks everyone.

推荐答案

在以下情况下会出现此消息:

That message appears under the following circumstances:


  • 您安装了Access数据库引擎(又名ACE),

  • 您为数据库连接创建了一个ODBC DSN,并且

  • 您的Java代码在JVM(Java虚拟机)中运行,其bit-ness与安装的ACE版本不同。

例如,


  1. 您可以安装32位版本的ACE并尝试从64位JVM中运行的Java代码连接,或者

  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

您可以安装64位版本的ACE并尝试从Java连接代码在32位JVM中运行。

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

如果确实想要使用JDBC-ODBC Bridge然后解决方案是切换到ACE的其他版本(即,从32位切换到64位,反之亦然),或者使用Java代码ru n在JVM下具有与已安装的ACE版本相同的位。

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.

(请注意,如果安装了Office,则切换到64位ACE 真的意味着切换到64位Office。您不能混合和匹配32位和64位Office组件。)

(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.)

但是,现在JDBC-ODBC Bridge已从Java 8中删除您应该考虑使用 UCanAccess JDBC驱动程序。它是一个纯Java实现,不使用Access ODBC来操作数据库,因此它可以在运行Java的所有平台(即不仅仅是Windows)上的32位和64位JVM下运行。有关详细信息,请参阅

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

在没有ODBC的情况下从Java操作Access数据库

这篇关于指定的DSN包含体系结构不匹配错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆