Please help: Connecting Microsoft Access Database (DAO)

Christian Tismer tismer at tismer.com
Wed Feb 16 09:17:58 EST 2000


Thomas Keil wrote:
> 
> Hello,
> 
> does anyone know how to get a Report from an Access Database?
> 
> "
>  import win32com.client
>  engine=win32com.client.Dispatch("DAO.DBEngine.36")
>  db=engine.OpenDatabase(r'foo.mdb')
>  rs=db.OpenRecordset('bar')
> "
> 
> 'bar' is a report; it needs two values: "first date" and "second date".

This is much more difficult that to get at a table or query.
Reports are no properties known to DAO, but they are
structures in MS Access, which is an application on
top of DAO.

The DAO database only knows about tables and queries, and
some other BLOB structures. In these BLOB structures
is oyur access application living, with its forms,
reports and modules. BTW, macroes are in tables.

Therefore, you need to build an interface to Access and
use its methods to get access to a Report.

I didn't do it before, but I guess it will take quite
a lot of trying and reading the Access help files on its
objects. Most probably you will have to use the
docmd.openreport method.

ciao - chris

-- 
Christian Tismer             :^)   <mailto:tismer at appliedbiometrics.com>
Applied Biometrics GmbH      :     Have a break! Take a ride on Python's
Düppelstr. 31                :    *Starship* http://starship.python.net
12163 Berlin                 :     PGP key -> http://wwwkeys.pgp.net
PGP Fingerprint       E182 71C7 1A9D 66E9 9D15  D3CC D4D7 93E2 1FAE F6DF
     we're tired of banana software - shipped green, ripens at home




More information about the Python-list mailing list