Article ID: 162958
Article Last Modified on 11/21/2006
static void PASCAL CompactDatabase( LPCTSTR lpszSrcName, LPCTSTR
lpszDestName, LPCTSTR lpszLocale, int nOptions, LPCTSTR lpszPassword );
Parameters
lpszPassword A password, used when you want to compact a
password-protected database. Note that if you use the
version of CompactDatabase that takes a password, you must
supply all parameters.
There is no information about the format of the password parameter.
However, the documentation for the DBEngine.CompactDatabase function has
the following information:
Syntax
DBEngine.CompactDatabase olddb, newdb [, locale [, options
[, ;pwd=password]]]
Part Description
password An optional string argument containing a password, if the
database is password protected. The string ";pwd=" must
precede the actual password.
/* Compile options needed: none
*/
/* The following code will compress the database C:\DB1.MDB, which has
* a password of "MyPassword"
*/
try
{
CDaoWorkspace::CompactDatabase( _T( "C:\\DB1.MDB" ),
_T( "C:\\DB2.MDB" ), dbLangGeneral, dbVersion30,
_T( ";PWD=MyPassword" ) );
}
catch( CDaoException* e )
{
AfxMessageBox( e->m_pErrorInfo->m_strDescription );
e->Delete();
}
Additional query words: Access Jet
Keywords: kbbug kbcode kbdatabase kbdocerr kbdocs kberrmsg kbfix kbvc600fix KB162958