I am writing a script that needs to make a connection to a microsoft access .accdb file and extract data from it.
Here is a snippet of what I am doing?
import pypyodbc
pypyodbc.lowercase = False
conn = pypyodbc.connect(
r'DRIVER={Microsoft Access Driver (*.mdb, *.accdb)};' +
r'DBQ=file.accdb;'
)
cur = conn.cursor()
I get the following error:
raise Error(state,err_text)
pypyodbc.Error: ('IM002', '[IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified')
I have installed the drivers for ODBC as instructed in https://docs.microsoft.com/en-us/sql/connect/python/pyodbc/step-1-configure-development-environment-for-pyodbc-python-development
But the error persists, any idea what should I do or where I am going wrong?