Compact & Repair on the fly...

S

Steven M. Britton

Here is the code to add to VB.

Private Sub CompactDB_Click()
On Error GoTo Err_CompactDB_Click

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

Exit_CompactDB_Click:
Exit Sub

Err_CompactDB_Click:
MsgBox Err.Description
Resume Exit_CompactDB_Click

End Sub

-Steve
-----Original Message-----
Hi!

Does anyone know how to programmatically compact and
repair the database on the fly? I have a database where
I'm creating and deleting tables and its size swells
quickly until I compact and repair manually.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top