[python-win32] Access and python

Bob Gailer bgailer at alum.rpi.edu
Thu Apr 17 11:04:46 EDT 2003

At 06:44 PM 4/17/2003 +0800, Norlin Abd Rahim wrote:
>Is it possible to do Database Utilities > Compact and Repair database in 
>Access using python?
For Access 2000 and (I assume) later:
 >>> import win32com.client
 >>> a = win32com.client.Dispatch("access.application")
 >>> a.DBEngine.CompactDatabase("c:\\db1.mdb", "c:\\db2.mdb")
win32com.client is part of Mark Hammond's winall package.
c:\\db1.mdb is the database to be compacted & repaired
c:\\db2.mdb is the file to which the resulting database will be written.

Bob Gailer
bgailer at alum.rpi.edu
303 442 2625
-------------- next part --------------

Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.467 / Virus Database: 266 - Release Date: 4/1/2003

More information about the Python-win32 mailing list