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?
set CONDA_FORCE_32BIT=1turned out to be out of date.