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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with MS Access Please

Status
Not open for further replies.

TinyNinja

Programmer
Oct 1, 2018
99
US
Hello everyone!

I need some help on creating a small program that will automatically compact a MS Access database for me.

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 have found different examples out there but all of them assume the database is not encrypted. I try different things to get the database open with no luck.

Does anyone have any ideas on how I can create this?
I am also open to creating this script in another language like Python.

Thank you in advance for the help! :)
 
Access' Application.DBengine has a CompactDatabase method that allows you to provide a password, eg something like:

oAccess.Application.DBEngine.CompactDatabase Datapath, TempFile, False, False, ";PWD=myPassword" 'Compact the file
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top