Display list of logged on system names

S

sunilkeswani

Hi

I used the Dev Ashish code from MVP site, but it only shows me the
current user.

******************** Code Start **************************
' This code was originally written by Dev Ashish.
' It is not to be altered or distributed,
' except as part of an application.
' You are free to use it in any application,
' provided the copyright notice is left unchanged.
'
' Code Courtesy of
' Dev Ashish
'
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 = vbNullString
End If
End Function
'******************** Code End **************************


How do I call this function in a query which will give me a list of all
logged on users?

Any help would be appreciated

Cheers
Sunny
 
D

Douglas J. Steele

You can't. That's not the point of that code: all it's intended to do is
tell you who the current user is.

You might be best off asking this in a newsgroup that's related to servers,
as it's not really an Access question.
 
S

sunilkeswani

Thanks. The MVP site download helps, atleast it returns to me the
system names of all current users. It is plain access so this should
work okay.

Cheers
Sunny
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top