Read from Microsoft Access via DAO and Python

Simple Database access to Microsoft Access via DAO and Python on Windows.

import win32com.client
daoEngine = win32com.client.Dispatch('DAO.DBEngine.35')
db = 'c:\\test\\mydatabase.mdb'
daoDB = daoEngine.OpenDatabase(db)
query = 'SELECT * FROM my_table WHERE my_attribute = 'my_search_value'
daoRS = daoDB.OpenRecordset(query)
print daoRS
daoRS.Close()

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.