Compacting a BE with password protection
Instead of running the code below on run prompt to compile the BE , is there no way we can run it from a form either when opening a start up form? We are given a facility to compact the FE on close .
msaccess.exe /pwd yourpassword /compact "C:\Users\chris.hankwembo\ Desktop\Hq Infor Premier_Mu.accdb"
I may be wrong but the code above appear to be opening my BE even if it is encrypted and password protected, if I'm right, is there a way to help user run this code at start up form?
A sketch will be highly appreciated.
Regards
Chris
msaccess.exe /pwd yourpassword /compact "C:\Users\chris.hankwembo\
I may be wrong but the code above appear to be opening my BE even if it is encrypted and password protected, if I'm right, is there a way to help user run this code at start up form?
A sketch will be highly appreciated.
Regards
Chris
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
alternately, you can use the DBEngine.CompactDatabase method:
Open in new window
This link explains the parameters:https://msdn.microsoft.com/en-us/library/office/ff844821.aspx
> "We are given a facility to compact the FE on close"
that may not be a good idea ... depending what is being done. It is good to compact/repair just after a file is backed up*, not after development or data entry has been done and the file is not backed up yet because compact/repair can be a volatile process. Front-ends shouldn't really need to be backed up anyway since they can just be redistributed. So, if this is the case, and you are just housekeeping, then compact on close should be ok for the front-end.
*For this reason, I would suggest compact/repair to a separate file for the back-end.
have an awesome day,
crystal