G
Guest
Is it possible to invoke the compact tool in Access 97 from a MDE file?
If so, how?
If not, any alternative?
If so, how?
If not, any alternative?
JaRa said:To compact the current mde or another mdb?
the dbengine object can compact a database ( DBEngine.CompactDatabase ).
- Raoul
example from helpfile
Sub CompactDatabaseX()
Dim dbsNorthwind As Database
Set dbsNorthwind = OpenDatabase("Northwind.mdb")
' Show the properties of the original database.
With dbsNorthwind
Debug.Print .Name & ", version " & .Version
Debug.Print " CollatingOrder = " & .CollatingOrder
.Close
End With
' Make sure there isn't already a file with the
' name of the compacted database.
If Dir("NwindKorean.mdb") <> "" Then _
Kill "NwindKorean.mdb"
' This statement creates a compact version of the
' Northwind database that uses a Korean language
' collating order.
DBEngine.CompactDatabase "Northwind.mdb", _
"NwindKorean.mdb", dbLangKorean
Set dbsNorthwind = OpenDatabase("NwindKorean.mdb")
' Show the properties of the compacted database.
With dbsNorthwind
Debug.Print .Name & ", version " & .Version
Debug.Print " CollatingOrder = " & .CollatingOrder
.Close
End With
End Sub