Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to automate compacting Access?

Status
Not open for further replies.

TinyNinja

Programmer
Oct 1, 2018
99
0
6
US
Hello everyone!

I am using MS Access Database 2016 / 365 version.
I am using this driver set = Microsoft Access Driver (*.mdb, *.accdb)
My database has the .accdb tag.
The database is encrypted so I need to be able to open the database with the password and then compact it.

I want to be able to automate the process of compacting and repairing the database because I am tired of doing it manually.
I want to have an .EXE file that I can just click on and it will open Access -> compact -> close Access and be done.
I have found examples of doing this but none of them involve having a password to deal with.

Thank you in advance for the help! :)
 
DBEngine.CompactDatabase SourceDB, DestDB, , , ";pwd=myPassword
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top