Avatar of Ross Temple
Ross Temple

asked on 

Retrieving data from a MS Access table using Python

I have a table TABLEAA in a MS Access database and I want to retrieve the data into some Python code.

I can connect to the database using win32com and run a query (SELECT, Z00, Z01, Z02, Z03 FROM TABLEAA) but how do I then refer to Z00, Z01 etc in the Python code? Here is my sample code...

import win32com.client
from win32com.client import Dispatch

strDbName = r'C:\\Users\Ross\Documents\TESTDB.mdb'
objAccess = Dispatch("Access.Application")
objAccess.OpenCurrentDatabase(strDbName)

objAccess.DoCmd.OpenQuery('AAQUERY')
DatabasesMicrosoft AccessPython

Avatar of undefined
Last Comment
aikimark

8/22/2022 - Mon