views:

50

answers:

2

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

I get the following error when I try to connect to my Microsoft Access database from an eclipse project using jdbc.

I am using 64bit windows and microsoft office 2007.

any help on this matter would be great.

A: 

64bit applications can't play with the 32bit Jet (Access) drivers. You need to fix this.

Two ways:

The hard, crazy cat lady way is to route the queries through something that can go both ways, such as installing the 32bit version of SQL Server Express, writing stored procedures in it to query the Access database, and then call the stored procedures from your 64bit application.

The easy, "correct", but potentially buggy for a short while way is to download and install the beta version of the Office 2010 Jet drivers (redistributable), which finally support 64bit mode. They can be downloaded from Microsoft here.

David
I see thank you very much.i downloaded the office 2010 drivers, however I am unsure on how exactly to use them.The instructions state: >If you are application developer using ODBC to connect to Microsoft Office Excel data, set the Connection String to “Driver={Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)};DBQ=path to xls/xlsx/xlsm/xlsb file” where exactly would i put this connection string if using jdbc to connect to the access database?
shane87
I would think the 64-bit ACE is now out of beta, since Office 2010 went gold in April, and the RTM version was made available for download on MSDN on April 22nd. I have it installed on my Win7 test laptop, in fact. So, the beta should have been replaced with a production version (since it's shipping in Office 2010), or it will be very soon.
David-W-Fenton
I actually just saw an announcement of Office 2010 going gold (retail gold) a few hours after this on Google News. And looking at the link now - it's no longer pointing at a beta download, but what appears to be the production one.
David
It actually went gold several weeks ago. I downloaded the RTM from MSDN on April 26th, for instance. The link is definitely no longer the beta.
David-W-Fenton
A: 

Access 2010 has 64 bit drivers and can be downloaded http://www.microsoft.com/downloads/details.aspx?FamilyID=C06B8369-60DD-4B64-A44B-84B371EDE16D&displaylang=en

Remou
The instructions state: >If you are application developer using ODBC to connect to Microsoft Office Excel data, set the Connection String to “Driver={Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)};DBQ=path to xls/xlsx/xlsm/xlsb file” where exactly would i put this connection string if using jdbc to connect to the access database?
shane87
That is the Excel driver, you may wish to look at this: http://stackoverflow.com/questions/1418807/accessing-access-over-jdbc-using-odbc
Remou
The download citation gives connect string instructions for Access via OLEDB and ODBC.
David-W-Fenton