Locking file persists even though all links to BE removed? (AC2007)

AOB

Registered User.
Local time
Today, 07:13
Joined
Sep 26, 2012
Messages
637
Hi guys,

I've put together a function which enables me to compact & repair the backend of my database from the frontend. Basically because, once I deploy the DB, I don't want to have to perform the maintenance on it myself - I'd prefer to just have a button on a form which allows the users to do it.

The process is as follows :

  • Confirm nobody is connected to the database (apart from the person performing the C&R, obviously)
  • Block any new connections to the backend while the C&R is running
  • Create a copy of the backend
  • Compact & repair the copy
  • Disconnect the frontend from the backend (by dropping all the linked tables)
  • Wait for the locking file (*.laccdb) to disappear
  • Switch the existing backend with the newly C&R'd copy
  • Add the linked tables back into the frontend
  • Unblock new connections to the backend
I've only got one problem - when I step through the code, it works perfectly. However, at run-time, I've noticed that the locking file does not disappear (even though nobody is connected to the backend, including myself as I have dropped all of the linked tables in my own frontend) I can't delete the existing backend while the locking file is there - but I don't understand why it persists?

Any suggestions?

Thanks

Al
 
Duh - scratch that fellas - I forgot I was using a dummy hidden form in the background to establish a persistant connection - even though the linked table was dropped, the link remains - have added code to close the hidden form and, hey presto, the locking file disappears.

Apologies for wasting anybody's time...
 
You haven't wasted anyone's time - this information is going to be very valuable to me very soon. I'm glad you posted your solution, as i'm sure others are (or will be) soon. :-)
 
Glad to hear it Agnieszka, and thank you for taking the time to post back!

If there's anything I can do to assist further just let me know

Al
 

Users who are viewing this thread

Back
Top Bottom