python,import pyodbc,,# 连接字符串,conn_str = (, r'DRIVER={Microsoft Access Driver (*.mdb, *.accdb)};', r'DBQ=你的数据库文件路径;',),,# 创建连接,conn = pyodbc.connect(conn_str),cursor = conn.cursor(),,# 执行查询,cursor.execute("SELECT * FROM 你的表名"),,# 获取结果,rows = cursor.fetchall(),for row in rows:, print(row),,# 关闭连接,cursor.close(),conn.close(),
``Powered By Z-BlogPHP 1.7.3
Copyright Your WebSite.Some Rights Reserved.