Updated version of David Crake's "View users logged into database" (1 Viewer)

Status
Not open for further replies.

isladogs

CID
Local time
Today, 13:00
Joined
Jan 14, 2017
Messages
13,602
Following requests from 2 forum members, I have updated & modified David Crake's utility to view users logged into a selected database.

See this closed thread: https://www.access-programmers.co.uk/forums/showpost.php?p=746480&postcount=1

The original only worked with MDB files and had a few issues

Changes made include:
1. It now works with ACCDB or MDB files.
2. Fixed issues monitoring databases on remote computers
3. List of users is updated automatically every 10 seconds
4. Improvements to the Lock Database feature

Info shown for each current user:
ComputerName - The computer name connected to the datafile
LoginName - (typically Admin) (aka: Access User Name)
Connected - Is the User Connected (Yes/No)
SuspectState - If Yes, the user has left the database in a "SuspectState" (possibly corrupted)



As in the original version, the utility allows you to lock external databases by creating a textfile 'Locked.txt' in the destination database folder
If this exists, a message is displayed stating that the database is unavailable due to system maintenance

For this to work successfully:
1. COPY the module modLockedOut to the selected database
2. ADD the line 'Call LockedOut' in the Form_Load event of the database startup form


EDIT 09/08/2017
The original code by David Crake required 3 non-standard VBA references
I have modified this removing the need for the Common Controls reference which wasn't installed with Windows 10 (and didn't work in 64-bit Access)
The updated reference list is:



NOTE:
When I'd almost completed this update, I discovered another similar utility by datAdrenaline also in the Sample Databases area:
https://access-programmers.co.uk/for...d.php?t=223434

Use whichever version you prefer ...
 

Attachments

Last edited:

dmorgan20

Registered User.
Local time
Today, 05:00
Joined
Apr 4, 2018
Messages
39
Brilliant - Works well. This raises some further questions.

I noticed the UI has a 'Disconnect User' feature - Which has not been developed, how this actually possible to do?

I also noticed that the computer name being picked up is actually the server name, making it difficult to identify who's actually connected. Is there an alternative way around this?
 

isladogs

CID
Local time
Today, 13:00
Joined
Jan 14, 2017
Messages
13,602
Hi
The two disabled buttons are features that David Crake said he was working on many years ago when he released his original version. I have to admit that I've not made any attempt to add these features and I believe you are the first person who has asked about them in all this time.
1. Its certainly possible to kick out all existing users. I do this in several apps using a table tblKickout with a Boolean field Kickout and one record. The value of that field is checked e.g. every 30 seconds. If set to true, a countdown procedure is initiated and after a set time e.g. 5 minutes, the app closes. I use this when an app needs to be closed for essential maintenance

However its not immediately obvious, at least to me, how to disconnect an individual user or why anyone would want to do so. I would welcome answers to both of those points.

2. The Send Message feature would be fairly simple to add. System tray alerts could be used when you want to message all users. Alternatively a simple messaging system (or email) could be used for individual users. Examples showing ways of alerting users can be found at https://www.access-programmers.co.uk/forums/showthread.php?t=295342 and http://www.utteraccess.com/forum/index.php?showtopic=1169381

I've not experienced any issues with the workstation listing as mentioned by you. What are the circumstances where this happens and which version/bitness of Access and Windows are you running?
 
Last edited:

CJ_London

Super Moderator
Staff member
Local time
Today, 13:00
Joined
Feb 19, 2013
Messages
12,222
just curious

The value of that field is checked e.g. every 30 seconds. If set to true, a countdown procedure is initiated and after a set time e.g. 5 minutes, the app closes.
does this work if the user machine is in sleep mode?
 

isladogs

CID
Local time
Today, 13:00
Joined
Jan 14, 2017
Messages
13,602
I believe so. All users were successfully disconnected after 6 minutes or so.
However it was normally used in conjunction with an idle disconnect feature whereby the app was closed if no user activity was detected within a specified time e.g. 20 minutes
 
Status
Not open for further replies.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Top Bottom