Compact Access 2000 from a batch file

rtdc

Registered User.
Local time
Today, 21:38
Joined
Feb 27, 2007
Messages
55
Hi All

I am looking to find some code that I can use in a batch file to compact an Access 2000 database that has a database password set on it.

I know about "C:\WIP\SPOC\OneCall_BE.mdb" /compact but need to find a way to pass it the password. What it does at the moment is open and waits for the password to be entered, and then it just opens.

I am looking to set up a scheduled task so that the database gets compacted every night.

Any ideas?

Cheers.
 
Code:
"C:\WIP\SPOC\OneCall_BE.mdb" /compact /wrkgrp "c:\someplace\OneCall.mdw" /pwd "secretp455wd"
When you need a password, you need a workgroup file as well. If not, you have done something wrong.

Remember that the password is visible in your batch file.

Enjoy!
 
This database does not use a workgroup, its uses the basic password from tools/security/set database password its all it needs. Though I am assuming no workgroup is associated?
 
Forgot about that one. Never used it. I have tried but failed to do it using a batch file.
 
This database does not use a workgroup, its uses the basic password from tools/security/set database password its all it needs. Though I am assuming no workgroup is associated?
A workgroup is always associated. In your case probably the default system.mdw which resides in the System32 directory.
 

Users who are viewing this thread

Back
Top Bottom