Connecting to MS accdb and read data into Pandas

Shaozhong SHI shishaozhong at
Tue Oct 12 04:40:26 EDT 2021

I tried the following code:
import pyodbc

conn = pyodbc.connect(r'Driver={Microsoft Access Driver (*.mdb,
cursor = conn.cursor()
cursor.execute('select * from table_name')

for row in cursor.fetchall():
    print (row)

But I could not connect to .accdb.

What is the robust way to set the connection string?



More information about the Python-list mailing list