Question : Knowing users logged in Access at any given time

I found the attached database on the internet. It is supposed to tell me who are the users looged in any Access database. When I run it though I get the error message attached as powerpoint. Any idea why?

Attachments:
 
Access DB to control users logged inother Access DB
 
 
Error Message
 

Answer : Knowing users logged in Access at any given time

After testing on an Access 2002-2003 format database on the network, these are my findings regarding the attached CurrentUsers.mdb:

  1. It is basically and effectively a GUI on the .ldb lock file. 
  2. It is more real time than simply reading the lock file. If a user appears in this tool, they *are* currently connected to the db. This is important because the lock file itself shows current as well as residual connection information. See Lock File note below. 
  3. It does not in its current form show name or ntuserid. Like the lock file, it only shows the db username which is always "Admin" unless you are using user-level security. As in my post http://a33191605, I recommend against user-level security. 
  4. Once again like the lock file, this db only shows the connected machine's hostname. You may still need a machine-to-user cross-reference. My company's machines are named based on the primary user, so this is a viable option for me. 

Lock File

When the first user connects to a db, Access creates a lock file in the same folder with the same name as the db, but with .ldb extension instead of .mdb. The file contains the user's machine name and db username. The db username is always "Admin" unless you are using user-level security. As more users connect to the db, Access adds their machine names and db usernames to the same lock file. When a user disconnects, their "slot" in the lock file remains with their info but is available for the next user that connects. This file is considered open and in use and is only deleted when the last connected user disconnects.

Lock File Permissions

The lock file is created under the effective NTFS and share permissions of the first connected user, and this user is the file's "owner". As long as this file exists, the owner and permissions do not change even if this user disconnects but others remain connected. The permissions on this lock file only change once the lock file is deleted and created by another user.

The Bottom Line
If you already use the lock file to determine "current" users, as I do, this tool enhances that with a GUI, and it is real time.

Lee

Random Solutions  
 
programming4us programming4us