Results 1 to 4 of 4
  1. #1
    New Lounger
    Join Date
    Feb 2002
    Location
    Netherlands
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Who's online? (2000)

    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?

  2. #2
    New Lounger
    Join Date
    Feb 2002
    Location
    Netherlands
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Who's online? (2000)

    Great! It works!

    Thanks!!!

  3. #3
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: Who's online? (2000)

    Hi,
    <!post=This thread,28344>This thread<!/post> may be of some use to you.
    Hope that helps.
    Regards,
    Rory

    Microsoft MVP - Excel

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Who's online? (2000)

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •