Using tsiCompactor to compact database

V

Vic Spainhower

Hello,

I am unable to get the tsiCompactor to work? When tracing I notice that it
attemps to Start the compact and immediately goes to the Failed routine.

Can someone tell me what I've missed?

Thanks, Vic


Function CompactDB()

Dim objTSICompact As clsTsiCompact
Dim strSourceDB As String
Dim strDestDB As String
Dim strDBdir As String
Dim sBackupDir As String

Set objTSICompact = New clsTsiCompact

'init

sBackupDir = DLookup("BackupDir", "SystemTable")

strDBdir = GetDBDir()
strSourceDB = strDBdir & "xpMyDatabase.MDB" '
Application file name.
strDestDB = sBackupDir & "\" & "xpMyDatabase.MDB" ' where
it goes

Call objTSICompact.CompactMyDatabase(strSourceDB, strDestDB)
Set objTSICompact = Nothing

End Function


---- Class Module

'TSI Compactor 4.0 (Build 3909)
Private WithEvents m_jet As TsiCompact.Jet

Public Sub CompactMyDatabase(Source As String, Destination As String)
Set m_jet = New TsiCompact.Jet

m_jet.CompactDatabase Source, Destination
End Sub

Private Sub m_jet_BeginCompact()
Debug.Print "Compact has started!"
End Sub

Private Sub m_jet_CompactFailed()
Debug.Print "Compact has failed. :-( "
End Sub

Private Sub m_jet_CompactProgress(UnitsDone As Long, UnitsTotal As Long,
Cancel As Boolean)
Debug.Print "Compact is " & UnitsDone & "/" & UnitsTotal; " of the way
through."
End Sub

Private Sub m_jet_EndCompact()
Debug.Print "Compact has Finished!"
End Sub
 

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