Kill user session

Posted on 2006-05-06
Last Modified: 2008-02-26

Am developing an application using MS access 2003 SP2 that will be used on local network by many users.

I need to know if I can kill a session for such a user (kick him out) in case of DB maintenance.
Question by:turki_00
    LVL 38

    Expert Comment

    LVL 58

    Accepted Solution


    Basically, you can't kick out a user, because each user runs his own instance of Access. So your application needs to do that. Typical solutions are a watchdog form (which can run hidden), checking something every five minutes or less. That "something" can be a flag in a  table, the presence of a text file, or simply the computer clock.

    Again, if the "kick out" is likely to occur during work time, the user should get some sort of warning. It's not really difficult to devise a solution.

    Tell me if you need more information,
    Good luck!
    LVL 38

    Expert Comment

    From the Access Workbench:
    Shutdown A Database and Send Messages to Users Running On Local PC's

    In situations where a database is copied to a local PC, shutting down the database and sending messages to users becomes a little more complex because the standard Workbench software relies on the front-end database being shared by all the users.  To get around this complication, you need the Shutdown and Message code that you add to you front end local database to look for a file on the server. The best way to do this is to look for a file associated with the backend version of your database. The same approach can be used when using multiple front-ends to link to one backend database.

    So open the shutdown form in your database and find (and change) this line of code in the CheckForMessage subroutine

    dbShutdownFilePath = Left(CurrentDb.Name, Len(CurrentDb.Name) - 4) & WBENCHSDFTYPE

    to either

    Dim BackendPath as string
    backendPath = "\\Server\folder\backendData.mdb”
    dbShutdownFilePath = Left(backendPath, Len(backendPath) - 4) & WBENCHSDFTYPE

    Author Comment

    Thank you harfang

    for leading my to the solution.

    Just set a hidden form with a timer and do the job.


    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    Concatination in Sample DB 14 49
    MsgBox 2 29
    Running Sum Issue 7 21
    message box formulas 3 17
    The first two articles in this short series — Using a Criteria Form to Filter Records ( and Building a Custom Filter ( — discuss in some detail how a form can be…
    Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
    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…
    With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

    729 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

    21 Experts available now in Live!

    Get 1:1 Help Now