I'm trying to connect to a .mdb database using the pyodbc module with the following code:
import pyodbc
MDB = 'C:\\Program Files (x86)\\OnCourt\\OnCourt.mdb'
DRV = '{Microsoft Access Driver (*.mdb, *.accdb)}'
PWD = 'qKbE8lWacmYQsZ2'
conn = pyodbc.connect('DRIVER={};DBQ={};PWD={}'.format(DRV,MDB,PWD))
This normally works absolutely fine but stopped working today, and I can't think why. This is the error I get:
InterfaceError: ('IM003', '[IM003] Specified driver could not be loaded due to system error 1114: A dynamic link library (DLL) initialization routine failed. (Microsoft Access Driver (*.mdb, *.accdb), C:\Program Files\Microsoft Office\root\VFS\ProgramFilesCommonX64\Microsoft Shared\Office16\ACEODBC.DLL). (160) (SQLDriverConnect)')
I don't think it's anything specific to the database I'm trying to access as when I try to configure the driver from within ODBC data sources, I get essentially the same error there too:
