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<SPAN class="punctuation token">.</SPAN>InterfaceError<SPAN class="punctuation token">:</SPAN> <SPAN class="punctuation token">(</SPAN><SPAN class="string token">'IM002'</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">'[IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified (0) (SQLDriverConnect)'</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN></SPAN>
This happens whether being run in a tool or whether the following code snippet is run from within the Python window in Pro:
conn <SPAN class="operator token">=</SPAN> pyodbc<SPAN class="punctuation token">.</SPAN>connect<SPAN class="punctuation token">(</SPAN><SPAN class="string token">'Driver={Microsoft Access Driver (*.mdb, *.accdb)};DBQ=P:\\Conservation Programs\\Natural Heritage Program\\Data Management\\ACCESS databases\\POND_entry\\POND_be.accdb;'</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN></SPAN>Any insight would be much appreciated.