Compact a Database

N

Nigel

How can I program automatic compalition of a database

Scenario:

I have copied my data file to a backup file from within the main file and
then want it to compact the saved file automatically, I know the name of the
file I just want to compile it after saving it what is the command for that


Thanks
 
S

Shaun

DBEngine.compactDatabase(SrcName As String, DstName As String, [DstLocale],
[Options], [SrcLocale])
 
C

chemhical

Try this:

Public Sub CompactDB()

CommandBars("Menu Bar"). _
Controls("Tools"). _
Controls("Database utilities"). _
Controls("Compact and repair database..."). _
accDoDefaultAction

End Sub
 
C

chooby

chemhical said:
Try this:

Public Sub CompactDB()

CommandBars("Menu Bar"). _
Controls("Tools"). _
Controls("Database utilities"). _
Controls("Compact and repair database..."). _
accDoDefaultAction

End Sub

How does the program know which database to compress??? Do you firs
need to link the database??
 
Top