Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Netware usercode? 1

Status
Not open for further replies.

Recordsetclown

Technical User
Jul 12, 2002
64
US
I'm looking for a way to identify an Access user without having that user sign into my application. Is it possible for the application to ID current user from the Netware login?

Thanks.

Jeff
 
An afterthought - our workstations are NT4, but soon will convert to XP. Is there something from the workstation login that is accessible?
 
You could try
strUserName=environ$("UserName")

of if that doesn't work (it depends on how your network is setup)
you could try

Private Declare Function apiGetUserName Lib "advapi32.dll" Alias _
"GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long

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 = &quot;&quot;
End If
End Function


strUser=fOSUserName()

HTH

Ben ----------------------------------------
Ben O'Hara
Home: bpo@SickOfSpam.RobotParade.co.uk
Work: bo104@SickOfSpam.westyorkshire.pnn.police.uk
(in case you've not worked it out get rid of Sick Of Spam to mail me!)
Web: ----------------------------------------
 
Thanks very much. I'll give this a try at work today and let you know how it works.

Jeff
 
Thanks again Ben. I was able to use the environment string and it worked fine.

Jeff
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top