I use DAO 3.6 object library and want to compact the MDB by using the following codes, but the "Type mismatch" error message occurs.. anybody can help me please ..
Private Sub CompactMDB()
Dim mApp as String
Dim mCompactApp as String
mApp = "C:\TeCS.MDB"
mCompactApp = "C:\MyCompact.MDB"
Dim errLoop As Error
Dim IsFile As Boolean
On Error GoTo Err_Compact
DBEngine.CompactDatabase mApp, mCompactApp, , dbEncrypt + dbVersion70
On Error GoTo 0
Exit Sub
Err_Compact:
For Each errLoop In DBEngine.Errors
mErr = True
Message "Compact unsuccessful!" & vbCr & _
"Error number: " & errLoop.Number & _
vbCr & errLoop.Description
Next errLoop
End Sub
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only