('IM002', '[IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified (0) (SQLDriverConnect)').
_ConnStr = 'Provider=Microsoft.ACE.OLEDB.12.0;Data Source=D:\\TEMP\\MYFILE.MDB;Persist Security Info=False;'
_conn = pyodbc.connect(_ConnStr)
Try connecting to the DB using the ODBC applet.
For 64 bit, use the one in C:\WINDOWS\System32\odbcad32.exe
If you can create a DSN and use the test button there OK, then you can just point to the DSN in Access. Long term, you'd be able to figure out the connection string from that.
And when you create the DSN, but a _64 on the end of it so you can tell you are using the right one.
Jim.
_ConnStr = pyodbc.connect(r'Driver={Microsoft Access Driver (*.mdb, *.accdb)};Data Source=D:\TEMP\MYFILE.MDB;')
arana: the line of code you have provided with pyodbc.drivers() doesn't list Microsoft Access Driver.
about dsn: i've both version installed (32/64), but Microsoft Access Driver is only listed in 32 bit version. And according to the article mentionned by John, it is not recommended to try to install another version of the driver other than the one installed by Office itself. I don't understand why it installed a 32 bits version when my Office installed is definitely 64.
john: the connection string you provided give me the same error. As Kevin mentionned, it's probably due to a mismatch of versions. Python 64 probably can't access a 32 bit driver. I'm actually try a repair to see if i'll have any option to install the 64 bit version of the ODBC driver.
In the meantime... i've access to an older computer with MS Access 2013, 32-bit, python 3.8 32-bit. So I'll give it a try.
Repair Office: Didn't worked. It never give me any choice, and at the end, the same drivers were installed but not this one.
Tests on older computer:
It has both drivers and it worked with my original code.
I might give a try to install the 64-bit driver and see if it solve the problem, or cause an havoc to my Office install.
Before breaking anything in my Office installation, i've done a last test: I've installed python 3.8.x 32-bit on my new machine and it's working.
Thanks a lot for the help you've provided
Kelvin