Rummaging around inside an Access DB

dsavitsk at my-deja.com dsavitsk at my-deja.com
Thu Dec 14 18:38:22 CET 2000


> (I can't find a help file on the object model
> anywhere!!)

If you are going to use DAO, then there is a book from O'Reilly
called "DAO Object Model, The Definitive Reference" that is probably
worth having (although at first glance i don't see anything about
Reports in it.)

you might also try ADO. Something like ...

>>> import win32com.client
>>> conn = win32com.client.Dispatch(r'ADODB.Connection')
>>> DSN = 'PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=C:/MyDB.mdb;'
>>> conn.Open(DSN)
>>> oCat = win32com.client.Dispatch(r'ADOX.Catalog')
>>> oCat.ActiveConnection = conn
>>> oRep = oCat.Reports
>>> for x in oRep:
...     if x.Type == 'REPORT':
...         print x.Name

... might work (by the way, this little bit of code was actually for
finding tables so i just changed 'TABLES' to 'REPORTS' etc. I don't
have any idea if it really works for reports, but the point is that
ADOX.Catalog might be a good place to poke around. (There is a slight
bit more info on access & ADO @ www.e-coli.net/pyado.html))


Sent via Deja.com
http://www.deja.com/



More information about the Python-list mailing list