Kill user session

Posted on 2006-05-06
Medium Priority
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
  • 2
LVL 38

Expert Comment

ID: 16621409
LVL 58

Accepted Solution

harfang earned 375 total points
ID: 16621672

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

ID: 16621791
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

ID: 16778899
Thank you harfang

for leading my to the solution.

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


Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
If you’re using QODBC to update QuickBooks data from Microsoft® Access but Access is not showing the updated data, you could have set up QODBC incorrectly.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
Suggested Courses

840 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