The problem with the database is that if the user switches off the PC without exiting the application, the entry in the database would still read as if the user is logged on.
This might not be much help to you but with NT Server there is a server manager that can show you all the users currently logged in and the applications that they are running.
I use the Computer Management Console (similar to what Tom is using) which is found under Administative Tools in WinXP. If the VB app is served, I think you'll need admin priveleges to that server to view open files.
>The problem with the database is that if the user switches off the PC without exiting the application, the entry in the database would still read as if the user is logged on
You can query the LDB file to find which user have been in the mdb since the ldb file was created, and which users are currently active.
There is a JET utility from MS (LDBView.Exe packed in the JETUTILS.EXE dowloadable from the MS site) which shows you who is logged in to the accompaning MDB.
You can also find out using the OpenSchema method of the connection object using the User Roster key:
Sub ADOUserRoster()
Const JET_SCHEMA_USERROSTER = "{947bb102-5d43-11d1-bdbf-00c04fb92675}"
Dim rst As ADODB.Recordset
Set rst = conn.OpenSchema(adSchemaProviderSpecific, , _
JET_SCHEMA_USERROSTER)
I would be inclined to store the MAC address of a user's NIC, together with a logon timestamp.
Then when a user logs on and they appear to be already logged on, you can update the timestamp. I'd be inclined to test the current log on time against this timestamp. If it's within a few hours I'd assume it's meant to be the same session, but over (say) 12 hours later then new session. The MAC address would allow you to differentiate between two logons on two different machines by the same user.
Darned if I can remember, but would I be correct in assuming that if a user's PC crashes the .ldb will still indicate that they are still an active user?
My tuppence-worth.
Regards,
Andy Watt
"Logic is invincible because in order to combat logic it is necessary to use logic." -- Pierre Boutroux
>Darned if I can remember, but would I be correct in assuming that if a user's PC crashes the .ldb will still indicate that they are still an active user?
Nope.
The user may be marked as logged, but not as an active user.
Only if some server cached the ldb file, as earlier versions of Novell did.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.