Hi all,
Sorry for asking so many questions but I think this should be the last for now :D
Is there anyway that I can write a code in VB6 to compact some Access 2.0 Database files (mdb)?
Thanks!!
Printable View
Hi all,
Sorry for asking so many questions but I think this should be the last for now :D
Is there anyway that I can write a code in VB6 to compact some Access 2.0 Database files (mdb)?
Thanks!!
You can use the Search facility of this forum to find the answers to many of your questions (like this one), but here it is anyhow. This example also repairs the database.
DBEngine.RepairDatabase "MyDB.MDB"
DBEngine.CompactDatabase "MyDB.MDB"
, App.Path & "compact.bak"
Kill "MyDB.MDB"
Name App.Path & "compact.bak" As "MyDB.MDB"
Hi Martinliss,
Thanks for the reply.
For your method given, after compacting the databases, am I still able to open it with Access 2.0? (Cos I have both Access 97 and Acess 2.0 installed).
Thanks!!
Sure. It's no different than compacting and/or reparing the database from within Access.