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

Kick all logged in users out of database

Status
Not open for further replies.

flaviooooo

Programmer
Feb 24, 2003
496
0
0
FR
Hey,

is there a way to kick all users that are logged into your database out of it. That way they can't get in the way of a compact operation, etc...

I know I can ask them to close the Db, but there are some resistant users here :)

Greetz
 
Try the following thread181-468123 I think it might be what you're looking for. I hope it helps.

Good Luck
mk
 
this has been often and extensively discussed. use the "advanced search" with key words like:

boot, kick, users, timer, hidden in various combinations. these threads are not as obvious in search as some topics, as the key words are somewhat more generally used than some others - but there are a number of soloutions scattered throughout the fora and not all are linked. Some of the threads / soloutions have more capability than others and some are somewhat easier to implememt, so a thorough search is worth the effort in getting the 'right' soloution for your situation, and may provide additional benefits as well.




MichaelRed
m.red@att.net

Searching for employment in all the wrong places
 
Here's my simple solution:

I have a back end database and a front end application which is located on each user's PC.

I have a table called Admin in the back end, with a field called AdminOn, which is a Yes/No data type

The front end has the Admin table linked.

In my startup form I have code in the OnOpen event that checks the value of AdminOn in the Admin table. If its Yes, then the user gets a msgbox telling them the database is in Admin Mode, please try later.

In my mainform (which is always open even when other forms open), I add code in the OnTimer event (set for a few minutes which I'm willing to wait for). Every few minutes the form's OnTime event is triggered and code similar to that in my startup form. Except that the message says something like, "Sorry for any inconvenience, but Admin requires full control of this application and must log all users off the system. The application will now close. Please try again later."

Now obviously, when the startup code is run, it does access the back end data to look in the Admin table - but if you handle the error that is raised when a user cannot get access because Admin has it open exclusively (preferably a GoTo type handler so you can give the user a message that the database isn't available and who to contact), then it works whether or not the user can actually open the back end.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top