Skip to content
Advertisement

“Operating system is not presently configured” error with Access ODBC

I get this error when I try to connect to Microsoft Access Database via Python. The code has been working all the time and only started popping the today. Can someone please guide me to why the problem may be occurring now?

I tried doing this “Operating system is not presently configured” error with Access ODBC even after removing the “Office 16 Click-to-Run Extensibility Component 64-bit Registration” my problem isn’t getting solved.

import pyodbc as pyo 
import os

#print(pyo.drivers())
filename='//MCISERVER1/TestData/access/Proof.mdb'
full_file=os.path.abspath(os.path.join('data',filename))
print("opening access")

Driver='{Microsoft Access Driver (*.mdb, *.accdb)}'
access_driver=['MS Access Database']

try:
     cnn=pyo.connect(driver=Driver,dbq=full_file,autocommit=True)
except pyodbc.Error as ex:
     print("Error connecting")

cursor=cnn.cursor()
sql="select * from [ERT ITRON] as e where e.SO='7888'"
cursor.execute(sql)
for row in cursor.fetchall():
    print(row)
print("success")
cursor.close()
cnn.close()
print("connection closed")




Advertisement

Answer

Had the same issue myself.

I downloaded new ODBC drivers from here: https://www.microsoft.com/en-us/download/details.aspx?id=54920

Thanks J

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement