View users logged into database MS Access 2016 (1 Viewer)

Nivaal

New member
Local time
Today, 20:44
Joined
Aug 8, 2017
Messages
2
Hi Everyone,

I hope someone can assist me. I have noticed a thread regarding a database that shows you users that are logged onto your database.

Thread Name: View users logged into database


Is there an update for this file to work with the MS Access 2016.

Please assist me if possible.

Thanks in advance.
 

isladogs

CID Moderator
Staff member
Local time
Today, 18:44
Joined
Jan 14, 2017
Messages
13,211
By pure chance I just posted a link to the same item for another user who still uses MDB files.

https://www.access-programmers.co.uk/forums/showpost.php?p=1542256&postcount=9

I will create an updated version of this utility to work with MDB or ACCDB files later today and post it here.
It won't take me long to modify

However in the meantime suggest you do another forum search in case someone has already done a version for ACCDB files
 

Nivaal

New member
Local time
Today, 20:44
Joined
Aug 8, 2017
Messages
2
Thank you so much!!

This utility isn't working well with my current database.

Will wait for the updated utility that works with MS Access 2016.

Thanks again
 

isladogs

CID Moderator
Staff member
Local time
Today, 18:44
Joined
Jan 14, 2017
Messages
13,211
Hi again

I've started work on updating this for ACCDB files.

However, I've found some issues with the original version by David Crake which I need to fix as well as 'porting' it to ACCDB.

Basically it seems to work for files open on the local PC but not those on another computer

So its going to take longer than I expected.
Unlikely to finish it today
 

isladogs

CID Moderator
Staff member
Local time
Today, 18:44
Joined
Jan 14, 2017
Messages
13,211
Hi

I've now completed updating & modifying David Crake's utility to view users logged into a selected database.

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



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

Use whichever version you prefer ... :cool:


EDIT 09/08/2017
The original code by David Crake requires 3 non-standard VBA references - see the screenshot in post #8.
I may modify it to remove the need for those references if I spend any more time on this
 

Attachments

Last edited:

moke123

AWF VIP
Local time
Today, 13:44
Joined
Jan 11, 2013
Messages
1,413
hi Colin,
i'm getting a missing Comdlg32.ocx error.
Any clues?
 

arnelgp

error reading drive A:
Local time
Tomorrow, 01:44
Joined
May 7, 2009
Messages
9,349
Remove it from reference
 

isladogs

CID Moderator
Staff member
Local time
Today, 18:44
Joined
Jan 14, 2017
Messages
13,211
hi Colin,
i'm getting a missing Comdlg32.ocx error.
Any clues?
Which Access version? 32/64 bit?

I had the same problem when I loaded the original.
The required reference is shown below



I've edited the previous post to mention this

Its an unusual bit of code (to me at least).
I may well replace this if I do any more with it but left it for now so I could release it for the benefit of interested forum users
 

Attachments

moke123

AWF VIP
Local time
Today, 13:44
Joined
Jan 11, 2013
Messages
1,413
win 10
Access 32

comdlg32 shows in system folder but not in references
 

isladogs

CID Moderator
Staff member
Local time
Today, 18:44
Joined
Jan 14, 2017
Messages
13,211
I created this in Access 2010 32-bit using Win 10
You should be able to browse and add the reference as I did

If not, perhaps you need to register the ocx?

Just remembered there are 2 files with that name dll & ocx
You need the ocx file

 

Attachments

moke123

AWF VIP
Local time
Today, 13:44
Joined
Jan 11, 2013
Messages
1,413
correction: comdlg32.dll is there but no comdlg.ocx
 

isladogs

CID Moderator
Staff member
Local time
Today, 18:44
Joined
Jan 14, 2017
Messages
13,211
Is it a bitness issue?

Just checked on my laptop which has Win10 & Office 2016 - both 64-bit
The file is missing - not installed with Win 10 apparently

I've uploaded my copy from my desktop PC - I have both Access 2010 & 2016 installed

After copying it from my desktop to SyWOW64 folder, the reference worked.

After updating an API declaration, the utility runs on 64-bit .... albeit with a message "There is no object in this control"
Fixed that by registering the ocx

However the Browse control which depends on that doesn't work in 64-bit.
So I'll update the example later today to use different code for the Browse control
 

Attachments

moke123

AWF VIP
Local time
Today, 13:44
Joined
Jan 11, 2013
Messages
1,413
just tried it on my office PC w/ win7 and worked fine.
must be win10 issue
 

isladogs

CID Moderator
Staff member
Local time
Today, 18:44
Joined
Jan 14, 2017
Messages
13,211
I'm only using windows 10 on both computers so that's not it.
Did you try installing the missing ocx file & registering it on win 10 machine?

Anyway, the comdlg32 reference is only used to browse for a file
As I can't get comdlg32 to work in 64-bit, I've now replaced that code & binned the reference

The new version now works perfectly in both 32-bit & 64-bit Windows / Access...
... as long as the test database is on the local computer

However the user list is not populated when I test a file stored on another computer.

Could you please test the utility on a database on a linked computer.
Does it work for you?
 
Last edited:

moke123

AWF VIP
Local time
Today, 13:44
Joined
Jan 11, 2013
Messages
1,413
just tried it on office computer with backend on a networked computer that i use for backends. the user list appears to work okay but although it wrote the lock text file to the folder with the backend it did not lock the front end from opening.

gotta wait till i get home to test with win10
 

isladogs

CID Moderator
Staff member
Local time
Today, 18:44
Joined
Jan 14, 2017
Messages
13,211
just tried it on office computer with backend on a networked computer that i use for backends. the user list appears to work okay but although it wrote the lock text file to the folder with the backend it did not lock the front end from opening.

gotta wait till i get home to test with win10
Hi again

Thanks for continuing to test this & providing feedback
It may be worth continuing via email or PMs rather than lots of to & fros on the main forum.

If it helps I can also upload v2 via email (PM me with your email if you want me to do so)

Please can you confirm :
a) Windows version & bitness (both home & work)
b) Access version & bitness (both home & work)

This is the current state of play:
1. Version 1 (uploaded to forum works on 32-bit Access but not 64-bit)
Version 2 (with comdlg32 removed) works on both 32-bit & 64-bit Access

2. User lists are correct for external databases on the local machine including users logging in from another computer on network (v1 & v2)
These databases can be successfully locked.

3. User lists are correct for external databases on another computer (v1 & v2)

4. Databases on another computer cannot be locked using either version - error 75 (file/path error)

5. The original MDB version of David Crake didn't work at all for files on another computer (nor in 64-bit Access)

I'll keep plugging away.
It keeps me away from another current task - trying to control dual monitor display properties using VBA

In the meantime, you might be interested in this post from another related thread
https://www.access-programmers.co.uk/forums/showpost.php?p=1542402&postcount=14
 

isladogs

CID Moderator
Staff member
Local time
Today, 18:44
Joined
Jan 14, 2017
Messages
13,211
Just realised the blindingly obvious
Error 75 when trying to create or delete the lock file on another computer is a permissions issue.
 

isladogs

CID Moderator
Staff member
Local time
Today, 18:44
Joined
Jan 14, 2017
Messages
13,211
Hooray!
I've fixed all the issues from earlier.

1. I have modified the code so the comdlg.ocx reference is no longer required. Updated reference list is:



2. It now works correctly in both 32-bit & 64-bit Access (& Windows)

3. You can now create or delete a lock file in the destination database folder on another computer PROVIDED you have read/write permissions to that folder
If not, a message explains that the user doesn't have the required permissions.

Once the lock file has been applied, the destination database cannot be opened.

As previously explained, for this to work you MUST first:
a) COPY the module modLockedOut to the selected database
b) ADD the line 'Call LockedOut' in the Form_Load event of the database startup form


Tested successfully using:
a) Access 2010 & Access 2016 32-bit and Windows 10 32-bit
b) Access 2016 64-bit & Windows 10 64-bit

I would appreciate any feedback - including its use in other versions of Access/Windows

I hope this is useful to others
 

Attachments

y770

New member
Local time
Today, 10:44
Joined
May 3, 2011
Messages
8
Hello;
I have downloaded both versions of the database and when running getting error: "Provider cannot be found. It may not be properly installed." See screenshot. This is the first time I am working with ACCDB files. Used to work with MDB and had my own similar program the worked fine with Microsoft.Jet.OLEDB.4.0. I have compared references, only the difference in 2 lines in versions of dll's. See second screenshot.
What am I missing here?
I am running MS Access 2010 (32 bits) on WIndows 10 (64 bits)

Thanks in advance for your help.
 

Attachments

isladogs

CID Moderator
Staff member
Local time
Today, 18:44
Joined
Jan 14, 2017
Messages
13,211
I haven't looked at this application since I posted it so it may be a while before I can give you an answer. I used to see that error on the old LDB viewer that worked on older Access files but not on this replacement

I have tested this in 32-bit Access 2010 & 32-bit Access 2016 (both on 32-bit Windows 10)
Also tested on 64-bit Access 2016 on 64-bit Windows

Unfortunately I can't test on your exact setup....

There is one odd reference - Microsoft Office 15.0 Access database engine is for Access 2013 so you either have or at some point had that on your computer. Perhaps it wasn't fully uninstalled? See if you can change it to Access 14.0 (2010) - it may solve the problem

Also, can you tell me EXACTLY when the message appears.
When it does so, press break & note the exact line of code triggering the error. You may need to add code breakpoints to do so.
That will help me identify the issue when I do look at it
 

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

Top Bottom