Results 1 to 3 of 3
  1. #1
    neishock is offline Novice
    Windows 2K Access 2007
    Join Date
    Oct 2010
    Posts
    1

    How to Boot off users

    Hello -- maybe someone out there knows if it is possible to do this:



    Nightly there is a job that runs to first run a bat file that makes a copy of the Access database file then a bat file runs to compact the database.

    More frequently than is acceptable one or more persons has connected to the database and forgot to close out before going home. Obviously this prevents the "compact" of the database.

    Is there a way to detect and close an open connection? or some other way of insuring that the database can be copied and then compacted?

    We do not care what the person that is connected was trying to do. The rule is to disconnect before going home -- so if they had needed to save something but had not, that will be their own problem. We don't need to worry about saving anything. I just need the database to be in a state that it can be compacted.

    Thank you for any assistance you can give!

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,640
    I've used the first, never tried the second (but the technique used is a common one):

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

    http://www.peterssoftware.com/fsd.htm
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    kimmer is offline Competent Performer
    Windows 7 Access 2010 (version 14.0)
    Join Date
    May 2010
    Posts
    100
    I got this a long time ago from a site that isnt around anymore. It may be dated.

    Create a field [LogOutStatus] in a system table of the backend that holds the values 1, 2 or 3
    Create a form in the frontend that stays open permanently (hidden)
    Activate the timer interval of this form
    Write code for the OnTimer event to control the field [LogoutStatus]
    Write code to leave the frontend
    Write code to verify the content of [LogOutStatus] on opening the frontend
    The functioning:

    The OnTimer-Event checks the value of [LogOutStatus]:
    1 = nothing
    2 = Display message "Application will shut down in a moment
    3 = Another message Message if desired and closing frontend


    On opening the frontend the same test has to be made.
    Code examples:
    Code:
    Ontimer-Event select case dlookup("[LogOutStatus]","tblSystem") 
    case 1
    ' nothing
    case 2
    call MessageBeforeShutDown
     
    case 3
    ' special Code for your application
    application.quit
    end select
     
    Sub MessageBeforeshutdown
    dim strMessage as string
    strMessage="ATTENTION: The database has to be shut down in 5 minutes" _r> & "Please finish your work and leave the program."
    msgbox strMessage
     
    end sub
    Please note:

    - The time between changing the value of [LogOutStatus] and the shut-down of the frontends depends on the setting of the timer interval
    - You need to control via VBA that the data manipulation will be terminated correctly
    - All open objects have to be closed on shut-down
    - You need to inform the users when the application is up again.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Force users to log off
    By Bruce in forum Security
    Replies: 8
    Last Post: 01-10-2013, 07:03 PM
  2. Access users
    By Captain in forum Access
    Replies: 3
    Last Post: 04-16-2010, 06:10 AM
  3. multiple users
    By ramkitty in forum Access
    Replies: 1
    Last Post: 03-22-2010, 07:15 PM
  4. How to have multiple users
    By Eric1066 in forum Access
    Replies: 5
    Last Post: 11-19-2009, 05:14 AM
  5. Allow some users to edit, and other to only view?
    By Tommy1005 in forum Security
    Replies: 2
    Last Post: 11-09-2009, 09:33 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums