Using the User Roster to Check for Users in a Microsoft Access Database
Provided by the FMS Development Team
Version 4.0 of the OLE DB Provider for Microsoft Jet added support for
several new schema rowsets that were not previously available. The most
notable of these is the User Roster schema rowset. The user roster is
exposed as a provider-specific schema rowset in the Jet 4 OLE DB provider.
Since provider-specific schemas are not listed in ADO's type library for
schema rowsets, you must use a GUID to reference the schema like this one.
The four things that can be returned for this schema are:
- Name of the computer that the user is using.
- Security name.
- Whether or not the user is currently connected to the database. (A user's ID remains in the lock database until the last user disconnects or until the slot is reclaimed for a new user connection.)
- Whether or not the user connection was terminated normally.
Below is an example Function of the User Roster code that checks which
users are in a Microsoft Access database. You should be able to cut and paste everything from
the "Begin Function" line to the "End Example" line into a new module and
have it work for you.
Required Library Reference: Microsoft ActiveX Data Objects
2.1 Library (or later version)
Sample VBA Code
An example of the VBA code is provided here:
VBA Code for Getting the
User Roster of a Microsoft Access Database
See it in Action
To see how we've applied these Microsoft Access Jet Engine
features into a database monitoring system, check out our
Total Access Admin product which gives you a live view of
users going in and out of your database. Manage multiple
databases in one screen and even log the activity into a
A fully functional,
free trial version of Total Access Admin is also