I'm on Windows with ArcGIS Pro 3.0.0 using the Python environment installed with ArcGIS Pro (arcgispro-py3 from Pro's install directory in Program Files) and I'm trying to make a database connection to an access database like so:
import pyodb
conn_string = r'DRIVER={Microsoft Access Driver (*.mdb, *.accdb)};' \
r'DBQ=C:path\to\mydatabase.mdb;'
connection = pyodbc.connect(conn_string)
I'm getting this error:
pyodbc.InterfaceError: ('IM002', '[IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified (0) (SQLDriverConnect)')
When I look at my drivers I see this:
>>>print(pyodbc.drivers())
['SQL Server', 'SQL Server Native Client 11.0', 'ODBC Driver 17 for SQL Server']
How can I make this connection work?
I've tried using a virtual environment (and explicitly uninstalling/reinstalling pyodbc from there) uninstalling/reinstalling ArcGIS Pro, and downgrading ArcGIS Pro to 2.9.
Solved! Go to Solution.
in my case, I was able to download and install the missing driver on my machine:
https://www.microsoft.com/en-us/download/details.aspx?id=54920
in my case, I was able to download and install the missing driver on my machine:
https://www.microsoft.com/en-us/download/details.aspx?id=54920