📜  ms 访问 python 数据框 - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:41.877000             🧑  作者: Mango

代码示例1
import pyodbc
import pandas as pd
...
cnxn = pyodbc.connect('DRIVER={{Microsoft Access Driver (*.mdb, *.accdb)}};DBQ=' + \
                      '{};Uid={};Pwd={};'.format(db_file, user, password)

query = "SELECT * FROM mytable WHERE INST = '796116'"
dataf = pd.read_sql(query, cnxn)
cnxn.close()