Compact Access database

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

imaley

Thread Starter
Joined
Mar 30, 2004
Messages
1
Hi :

is it possible to compact a password protected Access 2000 database from code? I tried this:

DBEngine.CompactDatabase "c:\backend.mdb", "c:\backend1.mdb", ";pwd=password"

but I get an "Invalid password" error. Yet the password correctly opened the backend.mdb without a fuss in normal circumstances.

Any help would be greatly appreciated.

Thanks,

Ian
 

Anne Troy

Anne
Joined
Feb 14, 1999
Messages
11,746
I don't think you can compact a DB from code unless the code is run from another DB.

See... a DB has to BE closed to compact it.
So it stands to reason that you can't be running code while it's closed...
 
Joined
Oct 3, 2002
Messages
2,281
You can compact an Access database

from a standalone VB application
OR
from another access database using VBA
OR
thru Tools > Database Utilities > Compact and Repair Database
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Staff online

Top