Has anybody got a working version for Access 2? I know, I have an oldie that needs some fixing but I need to know who (NT ID) is using this old db.
This is what I am using but it is bugging on the bolded line and the message is "Error in loading DLL."
Declare Function GetUserName Lib "AdvAPI32.dll" Alias "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long
Function fOSUserName () As String
'On Error Resume Next
'Returns the network login name
Dim lngLen As Long, lngX As Long
Dim strUserName As String
strUserName = String$(254, 0)
lngLen = 255
lngX = GetUserName(strUserName, lngLen)
If lngX <> 0 Then
fOSUserName = Left$(strUserName, lngLen - 1)
ElsefOSUserName = ""
End If
End Function
Thanks in advance for your help!