1

I use this code to retrive caompuetr name and other info from the user connected on access database:

Sub ShowUsers(strDatabase As String)
Dim cnn As New ADODB.Connection
Dim rst As New ADODB.Recordset

cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strDatabase & ";Persist Security Info=False"
Set rst = cnn.OpenSchema(adSchemaProviderSpecific, , "{947bb102-5d43-11d1-bdbf-00c04fb92675}")

Debug.Print rst.Fields(0).Name, rst.Fields(1).Name, rst.Fields(2).Name, rst.Fields(3).Name

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

rst.Close
Set rst = Nothing
cnn.Close
Set cnn = Nothing
End Sub

now i need to know the username(iduser) from the computer name is possible?

C-Pound Guru
  • 15,967
  • 6
  • 46
  • 67
user1579247
  • 107
  • 1
  • 6
  • Google tells (http://forums.devx.com/showthread.php?149878-Who-is-connected-to-my-mdb) that using this kind of schema query, you can get both computer and user names in results. What is your problem exactly? – Arvo Oct 01 '14 at 12:23
  • The returned user name is the database logon user, and lots of people just let everyone log on as "Admin" so that's the only name they will ever see reported. I suspect he wants to see each user's Windows logon name instead, which Jet doesn't track since it has no reason to. – Bob77 Oct 01 '14 at 14:59

0 Answers0