AnsweredAssumed Answered

PYODBC connection to Access not working within ArcGIS

Question asked by mmooreWPC on May 8, 2020
Latest reply on May 11, 2020 by rvburton

I have a Python script that connects to an Access database, brings in some data, and then appends to a feature layer in ArcGIS.


This script runs okay as a stand-alone script, but I am having issues creating the connection to the Access DB from within ArcGIS Pro. I installed the PYODBC module in the Python manager. Then, when I try to make a connection to the Access DB with the same code that works in the stand-alone script, I get this error message:



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


This happens whether being run in a tool or whether the following code snippet is run from within the Python window in Pro:


conn = pyodbc.connect('Driver={Microsoft Access Driver (*.mdb, *.accdb)};DBQ=P:\\Conservation Programs\\Natural Heritage Program\\Data Management\\ACCESS databases\\POND_entry\\POND_be.accdb;')


Any insight would be much appreciated.