A
Amos Sobel
I did write a big Access/Msql application which is using one VB function
which does recover the network UserName. Here it is:
Function fOSUserName() As String
' Returns the network login name
Dim lngLen As Long, lngX As Long
Dim strUserName As String
strUserName = String$(254, 0)
lngLen = 255
lngX = apiGetUserName(strUserName, lngLen)
If (lngX > 0) Then
fOSUserName = Left$(strUserName, lngLen - 1)
Else
fOSUserName = vbNullString
End If
End Function
This works OK under Windows XP but fails under Windows Vista.
The failure is in the String$ statement and the error report talks about a
missing project or library.
This means that Access 2002 is not compatible with Windows Vista and that
something must be done with the VB included in Access 2002. I know very
little about VB so I ask for this comunity's help.
Amos Sobel
which does recover the network UserName. Here it is:
Function fOSUserName() As String
' Returns the network login name
Dim lngLen As Long, lngX As Long
Dim strUserName As String
strUserName = String$(254, 0)
lngLen = 255
lngX = apiGetUserName(strUserName, lngLen)
If (lngX > 0) Then
fOSUserName = Left$(strUserName, lngLen - 1)
Else
fOSUserName = vbNullString
End If
End Function
This works OK under Windows XP but fails under Windows Vista.
The failure is in the String$ statement and the error report talks about a
missing project or library.
This means that Access 2002 is not compatible with Windows Vista and that
something must be done with the VB included in Access 2002. I know very
little about VB so I ask for this comunity's help.
Amos Sobel