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!

Identifying Network users - is .ldb file useful?

Status
Not open for further replies.

unislick

MIS
Dec 24, 2002
9
US
Hello!

I have created and maintained a database on a network server for quite sometime at work. I do not have special (admin) access to the server to view users logged on..etc.

My problem - I have multiple users using the database and I frequently need to make enhancements or modifications to the database front end (I have the back end tables split into another database). Is there anyway I can identify who (computer number, IP, etc..) is accessing the database so I can inform them directly to exit the database instead of having to send a note out to the entire user group? Is the .ldb file useful or is there any other tool that I can use? Any suggestions would me greatly appreciated.

Thanks
 
Here's a routine that I got somewhere a long time ago. I played with it a little and was able to get a listing of connected computers and users to print to the debug window.
Just change the connection strings to meet your situation.


Sub ShowUserRoster()
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim j As Long

On Error GoTo ErrHandler

cn.Provider = "Microsoft.Jet.OLEDB.4.0"
cn.Open "Data Source=c:\sols\Laundry_be.mdb"


' The user roster is exposed as a provider-specific
' schema rowset in the Jet 4 OLE DB provider. You have to use
' a GUID to reference the schema, as provider-specific schemas
' are not listed in ADO's type library for schema rowsets

Set rs = cn.OpenSchema(adSchemaProviderSpecific, , _
"{947bb102-5d43-11d1-bdbf-00c04fb92675}")

' Output the list of all users in the current database.
Debug.Print rs.Fields(0).Name, "", rs.Fields(1).Name, _
"", rs.Fields(2).Name, rs.Fields(3).Name

Do While Not rs.EOF
Debug.Print rs.Fields(0), rs.Fields(1), _
rs.Fields(2), rs.Fields(3)
rs.MoveNext
Loop


cn.Close

Exit Sub

ErrHandler:

For j = 0 To cn.Errors.Count - 1
Debug.Print "Conn Err Num : "; cn.Errors(j).Number
Debug.Print "Conn Err Desc: "; cn.Errors(j).Description
Next j


Resume Next

End Sub
 
Copy the LDB file, rename it to txt, and open it. That will give you the userid of the users who have the mdb open
 
Thanks psarros and wtmckown.

I tried psarros real quick and only got one id and it doesn't correspond to any available users and I know that at least 2 people are in the db currently.

I have the database password protected does this cause a problem?
 
The LDB doesn't always give you all the users. If a user have closed the database, his/her name stays on the LDB until all users close it. Then the LDB disappear.
 
I had the same problem until I downloaded the Microsoft Jet utilities (jetutils.exe). This includes an LDB viewer and some other useful tools. The LDB Viewer lists the users that are currently connected as well as the users that were connected since the creation of the current LDB file. It also shows suspect users in the event of database crash. Its a valuable tool to have in your Access development arsenal. Jetutils.exe is a free download available from the following website:


Jen
 
There is a utility called WohHasIt.exe which will tell you who has any file open and allow you to send them messages. I believe it is shareware and works only on Novell LANs. Your NW admin probably already has it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top