M
Mike
This seems pretty straight forward, but I can't get it to
work.
I'm running Access 97 with Jet SP3. I have the following
code in a class module called clsCompactor:
Option Compare Database
Option Explicit
Private WithEvents m_jet As TsiCompact.Jet
Public Sub CompactMyDatabase(Source As String, Destination
As String)
Set m_jet = New TsiCompact.Jet
m_jet.SystemDB = "c:\windows\access\mydoc.mdw"
m_jet.UserName = "name"
m_jet.Password = "password"
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
This is followed by code behind a button on a form that is
pointing to a database that is currently not in use (for
testing purposes):
Private Sub Compact_Click()
Dim objTSICompact As clsCompactor
Dim strSourceDB As String
Dim strDestDB As String
Dim strDBdir As String
Dim sBackupDir As String
Set objTSICompact = New clsCompactor
sBackupDir = "c:\DeLCom\Backup\"
strDBdir = "c:\DeLCom\"
strSourceDB = strDBdir & "axiom.MDB"
strDestDB = sBackupDir & "axiom.MDB"
MsgBox strSourceDB
MsgBox strDestDB
Call objTSICompact.CompactMyDatabase(strSourceDB,
strDestDB)
Set objTSICompact = Nothing
End Sub
It is not doing anything. I have made sure the .dll is
registered and compiling shows no errors.
Any suggestions?
Mike
work.
I'm running Access 97 with Jet SP3. I have the following
code in a class module called clsCompactor:
Option Compare Database
Option Explicit
Private WithEvents m_jet As TsiCompact.Jet
Public Sub CompactMyDatabase(Source As String, Destination
As String)
Set m_jet = New TsiCompact.Jet
m_jet.SystemDB = "c:\windows\access\mydoc.mdw"
m_jet.UserName = "name"
m_jet.Password = "password"
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
This is followed by code behind a button on a form that is
pointing to a database that is currently not in use (for
testing purposes):
Private Sub Compact_Click()
Dim objTSICompact As clsCompactor
Dim strSourceDB As String
Dim strDestDB As String
Dim strDBdir As String
Dim sBackupDir As String
Set objTSICompact = New clsCompactor
sBackupDir = "c:\DeLCom\Backup\"
strDBdir = "c:\DeLCom\"
strSourceDB = strDBdir & "axiom.MDB"
strDestDB = sBackupDir & "axiom.MDB"
MsgBox strSourceDB
MsgBox strDestDB
Call objTSICompact.CompactMyDatabase(strSourceDB,
strDestDB)
Set objTSICompact = Nothing
End Sub
It is not doing anything. I have made sure the .dll is
registered and compiling shows no errors.
Any suggestions?
Mike