Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Data source name not found and no default driver specified" with Access ODBC

My Softwares:

  • Python 3.4 -64 bit
  • PyODBC 64 bit
  • MS office package Installed (32 bit)

Problem:

Now, I try to access MS Access 2010 installed in my computer using PYODBC. It does not work regardless of what I try. My error is always this:

pyodbc.Error: ('IM002', '[IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified (0) (SQLDriverConnect)')

I already looked at:

pyodbc and ms access 2010 connection error

Cannot connect to Access DB using pyodbc

It is suggested that it is 32-64 bit problem which I am sure it is. Is there some modification that can be done to make it work without installing 32 bit python and 32 bit pyodbc? I checked this website.Using ODBC (32-bit and 64-bit) on 64-bit Windows which explains about accessing the control panel to modify ODBC connnection and/or drivers. However, I don't know much about windows database connection internals to commence some changes.

Is there something that I can do to make it work?

like image 511
Jack_of_All_Trades Avatar asked Oct 27 '14 21:10

Jack_of_All_Trades


People also ask

How do I fix data source name not found and no default driver specified?

You can check the drivers which are installed on your system by going to the ODBC Data Source Administrator. To open it, press ⊞ Win + R , and type in: odbcad32.exe . Then check the tab Drivers for installed drivers. The Name column indicates the exact name you should use in your connection string or DSN.

How do I find my ODBC driver name?

To check the ODBC SQL Server driver version (32-bit ODBC): In Administative Tools, double-click Data Sources (ODBC). Click the Drivers tab. Information for the Microsoft SQL Server entry is displayed in the Version column.


1 Answers

Is there some modification that can be done to make it work without installing 32 bit python and 32 bit pyodbc?

Not really. If you have 32-bit Office installed then you have the 32-bit version of the Access Database Engine (a.k.a. "ACE"), and only 32-bit applications can use it.

The installer for the 64-bit version of the Access Database Engine will abort if it detects 32-bit Office components. There is a way to force the installer to continue, but that is not recommended because it can apparently break Office.

Bottom Line: The "bitness" of your application must match the "bitness" of the installed Access Database Engine. So, practically speaking, your options are

  1. Use 32-bit Python and pyodbc, or
  2. replace your 32-bit Office with the 64-bit version.
like image 94
Gord Thompson Avatar answered Oct 05 '22 04:10

Gord Thompson