Application.CompactRepair

G

Guest

Application.CompactRepair "E:\PKA\BackupTables.mdb", "E:\PKA\Temp.mdb"

BackupTables.mdb is password protected. When I use the preceding command, I
can compact the database by entering the password when prompted.

I would like to include the password into the vb code so that I can
eliminate the prompt. One way would be to remove the password before
compacting but I don't like this approach. Is there a better way to do it?
 
J

Jeff Conrad

How about:

DBEngine.CompactDatabase "E:\PKA\BackupTables.mdb", "E:\PKA\Temp.mdb", , ";pwd:=password"

Put that all on one line.
Make sure you enter the correct password where it says 'password'.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top