Note
When using encrypted linked tables for action, update, and SQL queries [such as a SQL UPDATE statement (CurrentDb.Execute "UPDATE...")], you must supply the encryption key. Also, linked tables have a 19-character limit for the encryption key. See the Encrypted linked tables section at the end of this topic.
|
Name
| Required/optional
| Data type
| Description
|
---|---|---|---|
SrcName
| Required
| String
| Identifies an existing, closed database. It can be a full path and file name, such as "C:\db1.mdb". If the file name has an extension, you must specify it. If your network supports it, you can also specify a network path, such as "\\server1\share1\dir1\db1.mdb"
|
DstName
| Required
| String
| the file name (and path) of the compacted database that you're creating. You can also specify a network path. You can't use this argument to specify the same database file as SrcName.
|
DstLocale
| Optional
| Variant
| A string expression that specifies a collating order for creating DstName, as specified in Remarks.
If you omit this argument, the locale of DstName is the same as SrcName.
You can also create a password for DstName by concatenating the password string (starting with ";pwd=") with a constant in the DstLocale argument, like this: dbLangSpanish & ";pwd=NewPassword".
If you want to use the same DstLocale as SrcName (the default value), but specify a new password, simply enter a password string for DstLocale: ";pwd=NewPassword"
|
Options
| Optional
| Variant
| Optional. A constant or combination of constants that indicates one or more options, as specified in Remarks. You can combine options by summing the corresponding constants.
|
password
| Optional
| Variant
| A string expression containing an encryption key, if the database is encrypted. The string ";pwd=" must precede the actual password. If you include a password setting in DstLocale, this setting is ignored.
NOTE: This is deprecated parameter and is not supported in .ACCDB format. To encrypt an .ACCDB file, use the "pwd=" option string. Use strong passwords that combine upper- and lowercase letters, numbers, and symbols. Weak passwords don't mix these elements. Strong password: Y6dh!et5. Weak password: House27. Use a strong password that you can remember so that you don't have to write it down.
|
Constant
| Collating order
|
---|---|
dbLangGeneral
| English, German, French, Portuguese, Italian, and Modern Spanish
|
dbLangArabic
| Arabic
|
dbLangChineseSimplified
| Simplified Chinese
|
dbLangChineseTraditional
| Traditional Chinese
|
dbLangCyrillic
| Russian
|
dbLangCzech
| Czech
|
dbLangDutch
| Dutch
|
dbLangGreek
| Greek
|
dbLangHebrew
| Hebrew
|
dbLangHungarian
| Hungarian
|
dbLangIcelandic
| Icelandic
|
dbLangJapanese
| Japanese
|
dbLangKorean
| Korean
|
dbLangNordic
| Nordic languages (Microsoft Jet database engine version 1.0 only)
|
dbLangNorwDan
| Norwegian and Danish
|
dbLangPolish
| Polish
|
dbLangSlovenian
| Slovenian
|
dbLangSpanish
| Traditional Spanish
|
dbLangSwedFin
| Swedish and Finnish
|
dbLangThai
| Thai
|
dbLangTurkish
| Turkish
|
Note
The constants dbEncrypt and dbDecrypt are deprecated and not supported in .ACCDB file formats.
|
Constant
| Description
|
---|---|
dbEncrypt
| Encrypt the database while compacting.
|
dbDecrypt
| Decrypt the database while compacting.
|
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.
|
dbVersion40
| Creates a database that uses the Microsoft Jet database engine version 4.0 file format while compacting.
|
dbVersion120
| Creates a database that uses the Microsoft Access database engine version 12.0 file format while compacting.
|
Note
Because the CompactDatabase method doesn't convert Microsoft Access objects, you shouldn't use CompactDatabase to convert a database containing such objects.
|
Note
For Access 2007 (.accdb) databases, the password is the encryption key
|