How to connect MS Access to Python using pyodbc

I am using Win10 and Office 365, my problem resolved with installing Microsoft Access Database Engine 2016 Redistributable

Microsoft Access Database Engine 2016 Redistributable


Since you are using the 32-bit versions of both Microsoft Office and Python you should be good to go once you have the right connection string. It should look like this:

connStr = (
    r"DRIVER={Microsoft Access Driver (*.mdb, *.accdb)};"
    r"DBQ=C:\full\path\to\your\PYODBC.accdb;"
    )
cnxn = pyodbc.connect(connStr)