Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How to expel users from a database

Posted on 2011-09-30
8
Medium Priority
?
183 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 - Microsoft MVP, Access and Data Platform) earned 2000 total points
ID: 36893217

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
ID: 36893364
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
ID: 36893582
Sounds interesting ... and it's sure making me sleepy just thinking about it :-)

mx
0
NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

 
LVL 31

Expert Comment

by:hnasr
ID: 36895091
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
 
LVL 1

Author Comment

by:Milewskp
ID: 36902960
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
ID: 36904599
Peters app works! Guaranteed.

mx
0
 
LVL 1

Author Closing Comment

by:Milewskp
ID: 36904682
Thanks mx!
0
 
LVL 75
ID: 36904714
You are welcome.

mx
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
In a use case, a user needs to close an opened report by simply pressing the Escape (Esc) key. This can be done by adding macro code in Report_KeyPress or Report_KeyDown event.
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…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

916 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