I'm attempting to connect to an Access .mdb database with Python pyodbc. I connect to a local database, and this works fine. The database contains linked tables to a back end .mdb on a network drive. I receive this error when attempting to select from the linked table:
pyodbc.Error: ('HY024', "[HY024] [Microsoft] [ODBC Microsoft Access Driver] 'U:\OFFICE\GIS\accessdatabase.mdb' is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides. (-1023) (SQLExecDirectW)")
The path name is correct, and the linked tables work fine if I go into my local database and open them. The python program never mentions the network database or it's path at all, it only connects to the local database.
The python script works fine. I'm only getting the error when running the compiled .exe generated by Pyinstaller. Also, a coworker can compile on Windows 10 and his .exe works fine. But it has to compile on Windows 7 to produce an .exe that works on Windows 7.
Windows 7.
conn_str = (
r'DRIVER={Microsoft Access Driver (*.mdb)};'
r'Uid=Admin;Pwd=;'
r'DBQ=' + self.path
)
Any assistance or pointers would be greatly appreciated! Thanks