Application.CompactRepair

  • Thread starter Thread starter Guest
  • Start date Start date
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?
 
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'.
 
Back
Top