0

I have 64-bit Python installed on my machine along with 32-bit Microsoft Access. To get the "bits" to match I run set CONDA_FORCE_32BIT=1 in the Anaconda Prompt. However, when I loop through my drivers only "SQL Server" comes up. Example of the code below...

import pyodbc
for driver in pyodbc.drivers():
    print(driver)

So when I try to connect to the driver an InterfaceError comes up.

connStr = (r'Driver={Microsoft Access Driver (*.mdb, *.accdb)};'
           r'DBQ=P:\DataCompilation\DataCompilationPy\local_access_db\SiteData.accdb;'
          )
conn = pyodbc.connect(connStr)

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

I was able to import .csv data from the same location so the directory is at least not the problem. When I look for solutions they typically advise to have the same bit types for Python and Microsoft Access which I should have. Any advice?

2
  • This answer looks as though it should help - stackoverflow.com/questions/49117345/… Commented Oct 17, 2022 at 9:19
  • For anyone who might be looking at this in the future, I ended up just downloading the 32-bit version of Python because set CONDA_FORCE_32BIT=1 turned out to be out of date. Commented Oct 18, 2022 at 15:25

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.