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!

How to kick users out of a database.

Status
Not open for further replies.

CptCrusty1

Programmer
Feb 17, 2005
216
0
0
US
We are having problem with users getting into a database on not getting out. When we try to do maintenance, we can't because people still have the db open on their desktop. Due to company policies, we can't put password protection or build security into the database.

Is there a way to build a module which will kick any and all users out of a database? ANY HELP IS APPRECIATED

Thanks
signed: Frustrated
 
I have to do some searching, I did this about 4 years ago, to help you out now I can tell you there is a way to call their windows login information and kick them out of the DB by that, you can even reboot, shutdown, even log them off the computers. I will try to find my old db with the code set up on it.

Christopher Abney
There is no limit to the good you can do if you dont care who gets the credit
 
Oh Thats GREAT! What about sending a message to all users in a particular DB? That would give them a warning... something like.... "YOU HAVE ONE MINUTE TO LOG OFF OR ADMIN WILL LOG OFF FOR YOU, YADDA YADDA!"

That would be a really cool thing.....
 
Thats funny because this DB does that , you set the timer and it gets displayed to that user on a form that cycles down and then runs the script.

Christopher Abney
There is no limit to the good you can do if you dont care who gets the credit
 
That issue just came up this past week, and I was interested too.

Start here:



Two threads that talk about alternate pieces of what you are looking for. I have implemented this in a database that I manage, so if you can't get your answer from reading those threads, post here and I will try to help.
 
And if all else fails, an alternative method would be to go round to the user, tap them on the shoulder and say " get out of the database!"
Light humour....


Ian Mayor (UK)
Program Error
Programmers do it one finger at a time!
 

I've done it before just by using the server file management, checking which users are in the files and disconnecting them.. Couple of caveats:

No warnings!
Potental loss of data. I've only done it when I know they are not actually using it, but have just left it on. The auto refresh makes sure anything left on screen for 5 minutes is saved.
Potential corruption, as above



I have seen a database that monitors for the time of the last keystroke and display a warning and closes after 1 hour, but that could get annoying.
 
this is quit easy

make a table with an index and a textfield

the admin has a form to initiate "closing database"
on this form make a list box where u can select :
no action (default value)
1st warning
last warning
close

let the listbox update index 1 in your table

all the users have an hidden form that runs a timer lets say every 15 minutes
this timer checks wich action is in the textfield in your table

when the timer reads 'no action' it exits and restarts the timer

when '1st warning' it opens a form on the user-side with a warning message like "database will be closing in 15 minutes, finish your work and close the db"

same with warning 2

when the timer reads close
it activates the quit application and the db will close
 
...unless they have a dialog box or message box open. Or have a form where they have begun to enter information but not all required fields, so that when that form closes it will prompt them that the field cannot be empty.

These boxes have to be closed for the database to be unlocked by the user.

Then there is the necessity of the form to check the variable on load so that those who are trying to get into the database during a maintenance window will get a message telling them they can't get in. Only, that message can't start from within access since that would keep the database open, too. My suggestion in that case was a simple VBS file.

All of this was detailed in the previous two threads I mentioned.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top