This is a utility I put together to log the users who are connected to an MDB file. It uses the UserRoster recordset maintained by the Jet engine for Access versions 2000 - 2003 (and further I guess). The instructions are pretty simple ...
1. The interface form opens automatically (frmConnectedUsers)
2. You Browse for the .MDB file you want to examine.
3. "Refresh" the list of connected users (via a button or an "AutoRefresh" option)
Upon selecting an MDB file, the code will interrogate the MDB file and extract the Computer Names and Access User names that are connected (aka: have the file open) and store the data in a local table (tblConnectedUsers)
There are a couple of options when using this utility...(All options are saved in the table tblSettings)
- You can set an "AutoRefresh" rate which will run the analyzation at a given interval (uses Form_Timer)
- You can DELETE, MODIFY, or APPEND the records in tblConnectedUsers upon each "Refresh" attempt.
- You can either keep the connection object to the datafile static (aka: means you don't have to reconnect to the MDB after each Refresh ... this is MAY be helpful in finding the user who causes your database to go corrupt!)
When to use it ...
- Use to log who has/is connected to your datafile.
- If you set it to "AutoRefresh" at a given interval along with the "Update Records" option, you can find all the users that have logged on and when they logged off.
- You can use it to figure out who was connected to the datafile when the database goes "corrupt"
- I have found the app quite useful in tracking usage levels during the day and which computers are using my datafiles.
Fields in tblConnectedUsers ...
RecordID - AutoNumber
ComputerName - The computer name that was connected to the datafile
WorkGroupUser - The id of the user from the .MDW file on the ComputerName (typically Admin) (aka: Access User Name)
Connected - Is the User Connected (will only show No/False if you have the Update Records option set)
SuspectState - If the user has left the database in a "SuspectState" will show true, otherwise NULL
Cautions ...
YOU SHOULD NOT HAVE MULTIPLE INSTANCES OF THIS APP OPEN ... UNLESS YOU CHANGE THE NAME FOR EACH INSTANCE ... For example: you should not have two instances of "WhoIsConnected.mdb" on the same machine ... however, you can copy and rename the app as much as you want and open each copy... "WhoIsConnected_1.mdb","WhoIsConnected_2.mdb","WhoIsConnected_3.mdb"
Also, I have NOT tested this version of the utility on a CORRUPT database ... On my "Raw" version, I did not have any error checking and when the "Connection" errored out I knew my datafile was corrupt .. So on THIS "Developed" version, I have added some error checking AND have added the feature of keeping the connection to the datafile as a "STATIC" object (user option with the "Force a New Connection"), which SHOULD maintain the "Connection" to the datafile and allow an analyzation of the UserRoster when/if the datafile goes corrupt (the app just won't be able to establish a NEW connection)... I DID NOT have a database go corrupt durin the time I was monitoring it ... so ... well there you have it ... I hate to "Release" an app that has not been completely "UnTested" ... but I just could not get a datafile to become corrupt ... go figure!
Anyway, here it is ... Enjoy ... and PLEASE send me any recommendations for improvement or notifications of bugs...
Regards,
Brent
datAdrenaline
PS> There are no DLL's or Non-Standard "References" used by the app.
Edited by: khaos on Thu Oct 27 16:08:27 EDT 2005.
>>>Removed old attachment since a new one was added.