1:需用到 Python for Windows extensions
请首先安装 http://sourceforge.net/projects/pywin32/files/
2:需要 adodbapi
请下载安装 http://sourceforge.net/projects/adodbapi/
setup.py install
3:可使用如下测试程序
#!/usr/bin/env python # -*- coding: utf-8 -* import sys import win32com.client import adodbapi constr = 'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=%s' % 'e:/测试.mdb' conn=adodbapi.connect(constr) cur=conn.cursor() ############################################################ cur.execute('select * from [test]') print ('rowcount =',cur.rowcount) db = cur.fetchmany(100) for i in db: result="" #print (i) for j in i: result=result+j+' ' #result=result+j.encode('cp936')+' ' print (result) ############################################################ cur.close() conn.close()