Results 1 to 10 of 10
  1. #1
    Join Date
    Aug 2003
    Location
    Cleveland USA
    Posts
    184

    Smile Unanswered: How do I force users to disconnect from the database?

    I have a database on Access 97 that needs weekly maintenance (compact, maybe some minor changes too). I use Microsoft's LDBView utility to determine who's on the database, then call them to tell them to logout. I send an email the day before with a Flag reminder that goes off five minutes before they are supposed to logout, but I always get a couple of users who want to work to the last second. By the time I call them, a couple more people log in. Once this took 30 mins.

    So, what I want to do is be able to disconnect the folks who are logged in when it's time to take the database down. I have another question- if I do this, what happens to new or edited records that someone's working on, but they don't meet the validation requirements? Do they lose the record/changes or will it save incorrectly?

  2. #2
    Join Date
    Jul 2003
    Location
    Michigan
    Posts
    1,941
    Depends on how your users work with the app. If it's completely form driven,
    (the database is hidden from the users), you could use every forms OnTimer event. Call a function that compares the current Day/Time to a preset Day/Time

    If the current day is Friday, and the time is later than 5:00 pm, then
    Application.Quit will work nicely!

    Before you unceremoniously tossed them out, you would need to clean up any
    open records that they were in. Once it happened to them once or twice, they'd make sure they were done by 5:00 on Friday.
    Inspiration Through Fermentation

  3. #3
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    A quick note on the above mentioned method:

    I've used this a few times myself. I'm sure there's a better way but it's a good quick fix. Naturally if users listened (LOLOLOL) it wouldn't be necessary....

    Anywho, I create a small persistant form that's loaded at start up. Then in the unload event I set cancel = 1. Once the code is locked for distribution, there is no way to close the form and it can be used for persistant activities such as checking an administrative properties table for a "force close" bit.
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  4. #4
    Join Date
    Aug 2003
    Location
    Cleveland USA
    Posts
    184

    Smile

    Hmmm.. so, Application.Quit will close the database for everyone? It's not split, so everyone is working from the network copy.

  5. #5
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    I'm not sure you understand the suggestion. Application.Quit would be called from the individual client's machine based on this persistant form checking whether or not it you want it to close.
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  6. #6
    Join Date
    Aug 2003
    Location
    Cleveland USA
    Posts
    184

    Cool

    Oh! Thanks for the clarification. So, everyone's form has to boot them out. I'll probably have to get creative because the maintenance is not on a regular schedule. It might happen once every 8 days, or twice in a week, depending on how fast the database is swelling up. Now, if I set this up, and then I use the shift key to get in, will it bypass the forms and let me in? I like the persistent form idea because then I can change the time on it whenever I need to.

  7. #7
    Join Date
    Dec 2003
    Location
    Dallas, TX
    Posts
    1,004
    Hi Lisa,

    Just for the sake of information, here is the link to a site that offers such a program, but not sure if you or your company will wish to purchase, but take a look at what they offer. They have lots of stuff for Access.

    http://www.fmsinc.com/products/Admin/index.asp

    have a nice one,
    BUD

  8. #8
    Join Date
    Nov 2004
    Location
    Bangor, ME USA
    Posts
    44
    There is another option since people are only addressinhg half of your question, Your first part cna be handled with the following program located on the web.

    http://www.rogersaccesslibrary.com

    on this site goto other libraries and find the name "Neil Squires" in his section there is a DB called force users out.

    copy and look at it. To incorporate it into your own work copy the forms and the modules that are in his db.

    what this does is loads a hidden form (you may have to add to your startup routine [if you have one] yourself) and has a database administrator form that has some checkboxes on it.

    1 - Disallow new logins (this will take care of your 30 minute delays as if this form is open, no one else can log in to your program) [This is immediate]

    2 - Ask current users to finish what they are doing and log out (this will give them time to finish what they are doing (addressing your validation of data problem) sace and exit) [This is the hidden form that loaded before, and will repeat every minute] Immagine how pissed they get when the DB hounds them to log off - They'll get the message soon enough.

    3- Force remaining users out - this will forcibly shut down the arrogant ones who refuse to take a hint.

    and 4 - the lock file string with (in access 97 reset the # to 36)

    I believe neil has a copy of this DB in both 97 and 2K format

    but remember to keep the admin form open while you make your changes otherwise people can log in again.

    HTH
    Kevin

  9. #9
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    Nice find!

    I imagine I'll be spending some time there just to see what else I can find.
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  10. #10
    Join Date
    Jul 2003
    Location
    Michigan
    Posts
    1,941
    Quote Originally Posted by Kmcarman72
    There is another option since people are only addressinhg half of your question, Your first part cna be handled with the following program located on the web.

    http://www.rogersaccesslibrary.com

    Kevin

    SWEET! That's a great link.
    Inspiration Through Fermentation

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •