Repair a Database secured with an MDW file.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a database, split into front-end and back-end, and secured using a single MDW file with the user-level security permissions in it. I'd like to be able to put a button on the menu form (in the front-end obviously) that will execute a .CompactRepair or equivalent on the back-end. Using the CompactRepair procedure will not work as the database will refuse to open as it is secured

Is there an alternative method to do this? I'd rather not force users into openning the database and doing it manually as that would require some different security settings

Many Thank

Stephen Hynds
 
Use the undocumented PrivDBEngine object. Google search on dbengine
compactdatabase (or somesuch) & you will doubtless find some code.

HTH,
TC


Stephen Hynds said:
It's cool, I've fixed it. Just used the shell and some command line
options. Although I'm going to need to have look more into the security
issues it might raise, and make sure no one is in the back-end when its run.
 
Thanks TC, that works great

DBEngine.compactdatabase is either ignoring the username and password and compacting/repairing regardless, or it just takes the current user information access has for the front.mdb and applies it to the back.mdb (which would work as both database share a single MDW file)

But hey, it works and thats what counts

Best of all, it doesn't fire up a second copy of Access like my original workaround using the Shell command did, so its a much cleaner execution, and only required a couple of extra lines of code to kill the first database and Name the second one

Thank

Stephe

----- TC wrote: ----

Use the undocumented PrivDBEngine object. Google search on dbengin
compactdatabase (or somesuch) & you will doubtless find some code

HTH
TC
 
Back
Top