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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

About the environ 1

Status
Not open for further replies.

checkOut

Technical User
Oct 17, 2002
153
NL
I use Access2000
Some of our systems use Win2000, or Win98.

My bad experience is in Win98 the environ function
(run this one) has less features
Public Function Env(lngID As Long)
Dim i As Integer
For i = 1 To lngID
Debug.Print Environ(i)
Next i
End Function
The feature I need (Environ("username") is not available.
Anybody know how to solve this.
Maybe update a library or something.
or an other way to handle this, it's very important while I'm using through the whole app this function.

Thnx in advance,
Gerard
 
Code:
Private Declare Function WNetGetUser Lib "mpr.dll" Alias "WNetGetUserA" (ByVal lpName As String, ByVal lpUserName As String, lpnLength As Long) As Long

Public Function UserLoginName() As String

  Dim strName As String
  strName = Space(255)
  
  Call WNetGetUser("", strName, Len(strName))
  
  UserLoginName = Trim(strName)
  
End Function
VBSlammer
redinvader3walking.gif

Unemployed in Houston, Texas
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top