2
votes

After getting a new computer that is 64-bit I am getting the following error when I run my Python script that connects fine on my 32-bit computers. I am attempting to connect to an Access database. I am using 64-bit versions of python and pyodbc

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

Connection code I'm using that works great in 32-bit PC's:

cnxn = pyodbc.connect(r'DRIVER={Microsoft Access Driver (*.mdb, *.accdb)}; DBQ=managermeta.mdb; Provider=MSDASQL;')
1

1 Answers

4
votes

Download the 64-bit Office 2010 drivers from here. I was only able to test with an Access 2010 database, but it should work for 2007 also. You don't need the Provider attribute of the connection string.

cnxn = pyodbc.connect(r'DRIVER={Microsoft Access Driver (*.mdb, *.accdb)}; DBQ=managermeta.mdb;')