architecture mismatch between the Driver and Application?

自闭症网瘾萝莉.ら 提交于 2019-11-27 07:04:01

问题


I am using JDBC to connect to my microsoft access database. I get the following exception when I try to connect to the database:

java.sql.SQLException: [Microsoft][ODBC Driver Manager] The specified DSN contains an architecture mismatch between the Driver and Application

I am using 64bit windows7, and I am using eclipse which is also a 64bit version My database is a microsoft access database and it seems that the driver is a 32bit driver which is causing the problem.

Any help on how to solve this problem would be greatly appreciated.


回答1:


Check out the access 2010 redist

Microsoft Access Database Engine 2010 Redistributable

This download will install a set of components that can be used by non-Microsoft Office applications to read data from and write data to Office 2010 system files such as Microsoft Access 2010 (mdb and accdb) files and Microsoft Excel 2010 (xls, xlsx, and xlsb) files. Connectivity to text files is also supported. ODBC and OLEDB drivers are installed for application developers to use in developing their applications with connectivity to Office file formats.

This should suit your needs. Good luck!




回答2:


I don't have enough reputation yet to vote Yoda up, but I have to say that his solution is the most elegant I've come across. You could have also used a 32-bit JVM, but that is kind of silly. (If you encounter this on IIS you can make the application pool 32-bit, which is sort of the same thing.)



来源:https://stackoverflow.com/questions/2810754/architecture-mismatch-between-the-driver-and-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!