Humprey Evangelista Cogay

My Programming Adventures

Windows 7 64Bit Microsoft Access 2007 Problem [Solved] "architecture mismatch between the Driver and Application"

I just installed my PC with Windows 7 64bit, Microsoft Office 2007 and Visual Studio 2010. I was trying something and I have decided to use Microsoft Access as my database, After a few minutes I found my self scratching my head because I cannot Connect My App to my MS Access Database because of thess errors

         "The setup routines for the Microsoft Access Driver(*.mdb, *.accdb) ODBC driver could not be found. Please reinstall the driver"

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


Here are some screen shots


After googling around I found this 2007 Office System Driver: Data Connectivity Components  Just Download and install it.

and I also found this Windows 7 RC ODBC Access driver, So this lead me to C:\Windows\SysWow64. So what I did was to create a DSN File named MyAccessDatabase.dsn using the odbcad32.exe found inside C:\Windows\SysWow64 instead of the Data Sources (ODBC) Applet found under the Administrative Tools Control Panel Folder

Here's the resulting DNS File

     DRIVER=Microsoft Access Driver (*.mdb, *.accdb)
     FIL=MS Access

So this Works Perfectly now Cool

OdbcConnection cnn = new OdbcConnection();
            cnn.ConnectionString = @"filedsn=C:\Data\MyAccessDatabase.dsn;

            catch (Exception ex)

But if you dont use a File DSN this should Work Fine......

OleDbConnection cnn = new OleDbConnection(@"Provider=Microsoft.ACE.OLEDB.12.0;
Data Source=c:\database.accdb;Jet OLEDB:Database Password=password;"

Posted: 11-28-2010 10:23 PM by Comgen | with no comments
Filed under: , , ,