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

kick people off database

Status
Not open for further replies.

dolfan1873

Technical User
Aug 10, 2004
21
0
0
US
i am admin on a database that is kept on a server for our company, when the database has problems i have to call the IT people to get them to remove everyone from the database so i can fix the problem.

is there a way that i can set something up in the database the will kick everyone off the database so i can perform repair or work on the database.

this database is used in several different areas of our company (other states).
 
Add another form to your database and open it (hidden) at startup. Set the OnTimer event of the form to, say, 1 minute. In the OnTimer, open a table and check to see if a field is set. If set, then issue Application.Quit.

Note that this OnTimer event should also check a field to see if a message should be displayed on the user's machine. If so, then display the message (i.e. system going down in 5 minutes) and clear the flag.
 
could you please explain a little more, i am not getting it.

thanks.

also will this work from my pc, or does it have to be done at the server level.
 
Dolfan: What FancyPrairy said (In other words), was that:
1 you make a new form..
2 You load that form.
3 Make the form invisible.
4 Define a timer (1 minute)
5 Make some fields in a table, which the timer checks
6 Do the appropriate actions

I wonder if it's smart of you to try this, if you dont understand what he said.
I think you might damage the integrity of your database, if you are not experienced enough..

To give you a little more teaspoon:
1. Make a table "access_shutdown"
2. Make a field "shutdown_id", autonumber, key.
3. Make a field "notify_user", true/false.
4. Make a field "notify_message", text
5. Make a field "start_date", date
6. Make a field "work_done", true/false
What you will do?

When timer has counted to 0:

IF date = now AND work_done = false
IF notify_user = TRUE
'notify user and close database
ELSE
'close the database
END IF
ELSE
'loop timer again
END IF

ps. this code is not for usage, meerly description!
 
i got most of it, just lost it when he said to check table and see if a field is set.

besides i come here for advice not to be ridiculed, if that is all you have then please don't bother to answer my post again.
 
Hi dolfan!
Sorry if you thought I was ridiculing you..
I just had little time to answer the post, and didnt want you to try something, if you didnt know what you where doing.

Just remember to take backup before you try to change anything. I usually take daily backups, before changing anything.. Sometimes I forget and then I have alot of crappy work :(

There is also a more easy way to do this, if you do not want to notify the user.
if you want, I can tell you how.. (in easy steps).

good luck!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top