Solved

How to expel users from a database

Posted on 2011-09-30
8
161 Views
Last Modified: 2012-05-12
How can you use code to expel all users from a database?
0
Comment
Question by:Milewskp
  • 4
  • 3
8 Comments
 
LVL 75

Accepted Solution

by:
DatabaseMX (Joe Anderson - Access MVP) earned 500 total points
Comment Utility

I took Peter's FSD free app (http://www.peterssoftware.com/fsd.htm) ... and rolled it into a full blown app that works very well.

And related is this:

http://www.peterssoftware.com/isd.htm

These two will definitely do it for you.

mx
0
 
LVL 1

Author Comment

by:Milewskp
Comment Utility
Thanks mx,
I use the same method described in the first link you provided to kick users out. It's surprising how similar the two are.

The second link you provided is about how to kick out inactive (stale) users. I was planning to use the same idea for my databases, but I believe I now have a better idea: Instead of kicking out stale users, I plan to put the database in sleep mode:
- A modal pop up form called Sleep Mode opens to tell the user the database is sleeping.
- All linked tables are converted to local tables with one record each (to prelude the database from getting huge).
- Any persistent connections that were established to other databases are broken.

If the user hits the Wake Up button, then
- The tables are converted back to linked tables.
- Persistent connections are re-established (for speed).
- the current form is requeried.
- the Sleep Mode form closes.

The database will close at midnight regardless of what the user does.

Of course, this method applies only if each user has their own front end.
0
 
LVL 75

Expert Comment

by:DatabaseMX (Joe Anderson - Access MVP)
Comment Utility
Sounds interesting ... and it's sure making me sleepy just thinking about it :-)

mx
0
 
LVL 30

Expert Comment

by:hnasr
Comment Utility
One simple Idea:

a table in the database, to schedule for closing the database.

User's copy processes a timer event every say 5 minutes.
Reads the table and checks for close time.
Warns the user to exit the application.
New users are not allowed to enter.
At the right time, a force exit is issued if user did not respond.
0
Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 
LVL 1

Author Comment

by:Milewskp
Comment Utility
Hi hnasr,
I think that's basially what http://www.peterssoftware.com/fsd.htm does. Maybe the reason we are all coming up with the same answer is that there really is only one good way to do it.
0
 
LVL 75

Expert Comment

by:DatabaseMX (Joe Anderson - Access MVP)
Comment Utility
Peters app works! Guaranteed.

mx
0
 
LVL 1

Author Closing Comment

by:Milewskp
Comment Utility
Thanks mx!
0
 
LVL 75

Expert Comment

by:DatabaseMX (Joe Anderson - Access MVP)
Comment Utility
You are welcome.

mx
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now