Purpose
Compacts a closed database
Parameters
cOldDb | A string that identifies an existing, closed database. |
cNewDb | A string that is the file name (and path) of the compacted database that you are creating. You can also specify a network path. You can't use the cNewDb argument to specify the same database file as cOldDb |
cDstConnect | (Optional) A string composed of zero or more parameters separated by semicolons. This parameter is used to pass additional information to the destination database as needed. For example, collating order is specified here. |
lOptions | (Optional) A constant or combination of constants that indicates one or more options. The options specify the version of its data format and whether the new compacted database should be encrypted |
cSrcConnect | (Optional) A string composed of zero or more parameters separated by semicolons. This parameter is used to pass additional information from the source as needed. |
Settings
You can concatenate one of the following constants in the pstrDstConnect argument to specify the CollatingOrder for string comparisons of text in the compacted database.
Constant Sort order
dbSortGeneral General (English, French, German, Portuguese, Italian, and Modern Spanish)
dbSortArabic Arabic
dbSortChineseSimplified Simplified Chinese
dbSortChineseTraditional Traditional Chinese
dbSortCyrillic Russian
dbSortCzech Czech
dbSortDutch Dutch
dbSortGreek Greek
dbSortHebrew hebrew
dbSortHungarian Hungarian
dbSortIcelandic Icelandic
dbSortJapanese Japanese
dbSortKorean Korean
dbSortNeutral Neutral
dbSortNorwDan Norwegian or Danish
dbSortPDXIntl Paradox International
dbSortPDXNor Paradox Norwegian or Danish
dbSortPDXSwe Paradox Swedish or Finnish
dbSortPolish Polish
dbSortSlovenian Slovenian
dbSortSpanish Spanish
dbSortSwedFin Swedish or Finnish
dbSortThai Thai
dbSortTurkish Turkish
dbSortUndefined Undefined or unknown
You can use one of the following constants in the lOptions argument to specify whether to encrypt or to decrypt the database while it's compacted
Constant | Description |
dbEncrypt | Encrypt the database while compacting. |
DbDecrypt | Decrypt the database while compacting |
If you omit an encryption constant or if you include both dbDecrypt and dbEncrypt, cNewDb will have the same encryption as coldDb.
You can use one of the following constants in the lOptions argument to specify the version of the data format for the compacted database. This constant affects only the version of the data format of cNewDb and doesn't affect the version of any Microsoft Access-defined objects, such as forms and reports.
Constant | Description |
dbVersion10 | Creates a database that uses the Microsoft Jet database engine version 1.0 file format while compacting. |
dbVersion11 | Creates a database that uses the Microsoft Jet database engine version 1.1 file format while compacting. |
dbVersion20 | Creates a database that uses the Microsoft Jet database engine version 2.0 file format while compacting. |
dbVersion30 | Creates a database that uses the Microsoft Jet database engine version 3.0 file format (compatible with version 3.5) while compacting |
Class
DaoDbEngine The DBEngine object contains and controls all other collections and objects in the DAO object hierarchy
Example