|
-
April 20th, 1999, 10:51 AM
#1
How to use CompactDatabase with non .mdb files ?
I use DAO.
My application creates local files which are mdb files. When I create these files, I give them another extension rather than .mdb (let's say .pol).
I want to use CompactDatabase, but it seems that this method works only if the extension of the source and destination files is .mdb and no other one.
When I use CompactDatabase with FileSrc.pol and FileDest.pol it tells me that it doesn't find the ISAM pilot. It shouldn't look for any ISAM pilot as my files are Microsoft Jet databases.
Does anybody knoes how to work around the problem ?
-
October 1st, 2001, 05:15 AM
#2
Re: How to use CompactDatabase with non .mdb files ?
Hi..
I am a university student and want to use Access DB as backend in my VC++ application.
For that I want to compact the DB(i.e. MDB file)
to another .mdb file.
Can u please let me know , how it is done?
Thnx in advance
Regards
Vishal shewale
[email protected]
-
October 1st, 2001, 07:33 AM
#3
Re: How to use CompactDatabase with non .mdb files ?
You should be able to do it, doing like that :
CDaoDatabase daoBDD;
CString szYourSourceFile = "C:\MySourceFile.XXX"
CString szYourDestFile = "C:\MyDestFile.MDB"
// To be sure that the CompactDatabase works and understands that
// the file is an Access Base, you MUST pass it a ";pwd=" string
// as a password.
CString szConnection = ";pwd=" + "Your password";
TRY
{
// La méhode pour encrypter est une méthode de CDAOWorkspace
daoBDD.m_pWorkspace->CompactDatabase( szYourSourceFile,
szYourDestFile,
dbLangGeneral,
dbEncrypt,
szConnection);
}
CATCH(CDaoException, pException)
{
// Do whatever you want
}
END_CATCH
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|