• Who’s online? (2000)

    Author
    Topic
    #368578

    CurrentUser() shows user currently loggen on to the database. In a non-secured database the result is always “Admin”.
    I want to track down the (user)name of the network-user currently using that computer. How can I do that? Reading the ldb-file of the active database also results in “Admin”.

    Who can help?

    Viewing 1 reply thread
    Author
    Replies
    • #577971

      Hi,
      This thread may be of some use to you.
      Hope that helps.

    • #577969

      If you’re on a network, you can use a Windows API call. Put the following code in a module:

      Private Declare Function WNetGetUser Lib “mpr.dll” Alias “WNetGetUserA” _
      (ByVal lpName As String, ByVal lpUserName As String, lpnLength As Long) As Long

      Function NetUser() As String
      Dim strName As String, strUserName As String, intPos As Integer
      strName = vbNullString
      strUserName = Space(25)
      If WNetGetUser(strName, strUserName, Len(strUserName)) = 0 Then
      intPos = InStr(strUserName, vbNullChar)
      NetUser = Left(strUserName, intPos – 1)
      Else
      NetUser = “unknown”
      End If
      End Function

    Viewing 1 reply thread
    Reply To: Who’s online? (2000)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: