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

Forcing Users to Log Off during Maintenance

Status
Not open for further replies.

fogal

Technical User
Aug 20, 2001
87
US
Does anyone know the correct procedure that should be used to force users to log off a database when the developer performs maintenance on the database.

The db has a workgroup file, and is accessed via a shortcut. I can also get a list of all users logged on the database. However, there is no seperate back end for this db.

I want to provide logged on users with a msgbox stating the db session will end in 2 minutes etc....., before killing users.

Any suggestions ??
 
This question sounds similar to a previous post...

Try following the tread below:

thread705-228405

Hopefully, you've split the db into front end/back end db's, which makes maintenance of the tables a lot easier. Your front end can take care of accessing the back end db, so you can change your startup menu to an "off line" maintenance menu whenever you want to.

I'd create a button on the main menu that's visible to you(based on your LAN login) that would allow changing the startup menu to an offline menu, then on the offline menu, you can have the same type of button for switching it back.
 
Go to and look at his code library. He has a sample database that uses a table and form timer events. In a nutshell, the form timer event fires every 5 minutes looking at the value set in the table. if the value is set to true, then open a form to the users advising them that the database will close in approximately 5 minutes (as the timer is not that accurate). Next, after the lapse of 5 minutes, the vba calls for the application to quit and shuts it down - ALL instances. Furthermore, as long as the value in that table is set to true, noone can access the database. A message box is created that displays "Database unavailable at this time. Please try later." I am using it in several different applications and it works great. If you have not disabled the shift key, you can bypass the msgbox because that is included in an AutoExec function. Try it out - there is also other great information there.

Good Luck

Lee
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top