I am trying to connect to a .mdb database from Python using the pyodbc library. The connection string I am using is the following:
import pyodbc
conn = pyodbc.connect('DRIVER={Microsoft Access Driver(*.mdb,*.accdb)};DBQ=C:\\Sample.mdb')
But I keep getting the IM002 error telling me that the data source name is not found and that the driver has not been specified. But the thing is that both of them are present in the ODBC Manager.
What I have tried:
I have tried adding the DSN again in the ODBC Manager. This link :
https://social.msdn.microsoft.com/Forums/getfile/1146756 is the User DSN setting and this :
https://social.msdn.microsoft.com/Forums/getfile/1146757 is the system DSN setting.
I even created a file DSN to get the complete connection string, and the error still appeared. The PC I am working on is 64 bit, so I changed the directory path in the 'Shortcut' tab of the ODBC Manager properties to point to the SysWOW64 folder. So I am unsure as to what the error is. Any assistance would be useful
I am using 64 bit versions of Python and the pyodbc library. I was wondering if I should downgrade given that I am unsure of the same about MS Access that is installed on the PC.
PS: I seem to have messed up adding the image link. Please copy and paste the link into the browser.