CompactDatabase - method of object PmDatabase

It defragments all database tables and creates a new defragmented database on the disk. The method works only with the database of the Access type.
CompactDatabase(sDstDb As String, nLocale As Long, sPassword As String, nOptions As Long) As Boolean
oDb.CompactDatabase sDstDb, nLocale, sPassword, 0
sDstDb(String) Name of the destination defragmented database. It must differentiate from the database defined by the PmDatabase object.
nLocale(Long) Language of the new created sDstDb database
sPassword(String) Password for an access to the database
nOptions(Long) Not used, set to 0.

If new records are added and removed when working with the database table of the Access type, then it can occur to the situation when the size of the used space on the disk is increasing even though the number of table records is constant. The PmDatabase object must be closed before using this method (e.g. by the Close method).

The method is not functional if the Technology configurator is set to Access through ODBC.

Dim oDb
Set oDb = pMe.Pm("/Database")
oDb.CompactDatabase "C:\defrag.mdb", 0, "", 0
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice