brightstar
Technical User
- Sep 20, 2002
- 233
OK, Ive converted and Access 97 db into 2K. But now my function that identifies the current logged on user doesnt see to work. its an API called advapi32.dll i think. here it is:
' Declare Function
Declare Function wu_GetUserName Lib "advapi32.dll" Alias _
"GetUserNameA" (ByVal lpBuffer As String, nSize As Long) _
As Long
Function ap_GetUserName() As String
' Declare Variables
Dim strUserName As String
Dim lngLength As Long
Dim lngResult As Long
' Set up the buffer
strUserName = String$(255, 0)
lngLength = 255
' Make the call
lngResult = wu_GetUserName(strUserName, lngLength)
' Assign the value
ap_GetUserName = Left(strUserName, 8)
End Function
normally this would give you the username, on our NT network, but on the NT laptop it gives |||||||||||||||.
any ideas how i can fix it?
' Declare Function
Declare Function wu_GetUserName Lib "advapi32.dll" Alias _
"GetUserNameA" (ByVal lpBuffer As String, nSize As Long) _
As Long
Function ap_GetUserName() As String
' Declare Variables
Dim strUserName As String
Dim lngLength As Long
Dim lngResult As Long
' Set up the buffer
strUserName = String$(255, 0)
lngLength = 255
' Make the call
lngResult = wu_GetUserName(strUserName, lngLength)
' Assign the value
ap_GetUserName = Left(strUserName, 8)
End Function
normally this would give you the username, on our NT network, but on the NT laptop it gives |||||||||||||||.
any ideas how i can fix it?