Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Number of users running a VB EXE

Status
Not open for further replies.

ndalli

Programmer
Nov 6, 1999
76
MT
Hi,

I need to know how many users are using the application concurrently.

Is it possible to know how many people are currently running the VB EXE file?

Thanks in advance
 
do u want to track this across a LAN?

if so the only way that strikes me is to use a databse that can be shared across a LAN.

Known is handfull, Unknown is worldfull
 


Yes, its over a LAN.

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

What type of database?
 
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)

Debug.Print rst.GetString
rst.Close

End Sub

Have fun...



 
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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top