LDB Viewer -- Need to get NT user login name in addition to computer name 
Author Message
 LDB Viewer -- Need to get NT user login name in addition to computer name

Does anyone know how to modify the MS LDB Viewer to capture the NT username
instead of the machine name?  In my situation, it would be helpful to know
both.  For example, if a user logs in at the machine across the hall and
uses my DB, LDB Viewer will tell me WHERE the user is, but not necessarily
WHO the user is.  I would like to know both.

Here's the part of the original code that looks relevant to me:

Option Compare Database
Option Explicit

'You use the following constants with the LDBUser_GetUsers
'function's "nOptions" parameter below.
Public Const OptAllLDBUsers = &H1
Public Const OptLDBLoggedUsers = &H2
Public Const OptLDBCorruptUsers = &H4
Public Const OptLDBUserCount = &H8
Public Const OptLDBUserAuthor = &HB0B

Declare Function LDBUser_GetUsers Lib "MSLDBUSR.DLL" _
  (lpszUserBuffer() As String, ByVal lpszFilename As String, _
  ByVal nOptions As Long) As Integer

Declare Function LDBUser_GetError Lib "MSLDBUSR.DLL" _
  (ByVal nErrorNo As Long) As String _

Function GetComputerNames(ByVal strMDB As String, _
                          ByVal lngOptions As Long, _
                          ByRef varArray As Variant) _
                          As Integer

    Dim intReturn As Integer

    ReDim astrBuffer(1) As String

    intReturn = LDBUser_GetUsers(astrBuffer, strMDB, lngOptions)

    GetComputerNames = intReturn

    If intReturn < 0 Then
        varArray = LDBUser_GetError(intReturn)
    Else
        varArray = astrBuffer()
    End If
End Function



Sat, 19 Oct 2002 03:00:00 GMT  
 LDB Viewer -- Need to get NT user login name in addition to computer name
If you figure this one out, PLEASE let me know!

The best I can recommend is to implement Access security.  Then it's easy to
capture Access usernames (not system logins, though...)

- Turtle

Quote:

>Does anyone know how to modify the MS LDB Viewer to capture the NT username
>instead of the machine name?  In my situation, it would be helpful to know
>both.  For example, if a user logs in at the machine across the hall and
>uses my DB, LDB Viewer will tell me WHERE the user is, but not necessarily
>WHO the user is.  I would like to know both.

>Here's the part of the original code that looks relevant to me:

>Option Compare Database
>Option Explicit

>'You use the following constants with the LDBUser_GetUsers
>'function's "nOptions" parameter below.
>Public Const OptAllLDBUsers = &H1
>Public Const OptLDBLoggedUsers = &H2
>Public Const OptLDBCorruptUsers = &H4
>Public Const OptLDBUserCount = &H8
>Public Const OptLDBUserAuthor = &HB0B

>Declare Function LDBUser_GetUsers Lib "MSLDBUSR.DLL" _
>  (lpszUserBuffer() As String, ByVal lpszFilename As String, _
>  ByVal nOptions As Long) As Integer

>Declare Function LDBUser_GetError Lib "MSLDBUSR.DLL" _
>  (ByVal nErrorNo As Long) As String _

>Function GetComputerNames(ByVal strMDB As String, _
>                          ByVal lngOptions As Long, _
>                          ByRef varArray As Variant) _
>                          As Integer

>    Dim intReturn As Integer

>    ReDim astrBuffer(1) As String

>    intReturn = LDBUser_GetUsers(astrBuffer, strMDB, lngOptions)

>    GetComputerNames = intReturn

>    If intReturn < 0 Then
>        varArray = LDBUser_GetError(intReturn)
>    Else
>        varArray = astrBuffer()
>    End If
>End Function



Sat, 19 Oct 2002 03:00:00 GMT  
 LDB Viewer -- Need to get NT user login name in addition to computer name
Maybe this link will help:

    http://www.mvps.org/access/api/api0008.htm

It gives code for using a Windows API function to retrieve the network login
name.
--

Dirk Goldgar
(remove NOSPAM from reply address)


Quote:
> Does anyone know how to modify the MS LDB Viewer to capture the NT
username
> instead of the machine name?  In my situation, it would be helpful to know
> both.  For example, if a user logs in at the machine across the hall and
> uses my DB, LDB Viewer will tell me WHERE the user is, but not necessarily
> WHO the user is.  I would like to know both.

> Here's the part of the original code that looks relevant to me:

> Option Compare Database
> Option Explicit

> 'You use the following constants with the LDBUser_GetUsers
> 'function's "nOptions" parameter below.
> Public Const OptAllLDBUsers = &H1
> Public Const OptLDBLoggedUsers = &H2
> Public Const OptLDBCorruptUsers = &H4
> Public Const OptLDBUserCount = &H8
> Public Const OptLDBUserAuthor = &HB0B

> Declare Function LDBUser_GetUsers Lib "MSLDBUSR.DLL" _
>   (lpszUserBuffer() As String, ByVal lpszFilename As String, _
>   ByVal nOptions As Long) As Integer

> Declare Function LDBUser_GetError Lib "MSLDBUSR.DLL" _
>   (ByVal nErrorNo As Long) As String _

> Function GetComputerNames(ByVal strMDB As String, _
>                           ByVal lngOptions As Long, _
>                           ByRef varArray As Variant) _
>                           As Integer

>     Dim intReturn As Integer

>     ReDim astrBuffer(1) As String

>     intReturn = LDBUser_GetUsers(astrBuffer, strMDB, lngOptions)

>     GetComputerNames = intReturn

>     If intReturn < 0 Then
>         varArray = LDBUser_GetError(intReturn)
>     Else
>         varArray = astrBuffer()
>     End If
> End Function



Sun, 20 Oct 2002 03:00:00 GMT  
 LDB Viewer -- Need to get NT user login name in addition to computer name
I don't know the answer to yur question, however, if anyone of you could
direct me to where I could get a copy of the MS LDB Viewer I would be very
grateful

Thanks

Joe Floeder


Quote:
> Does anyone know how to modify the MS LDB Viewer to capture the NT
username
> instead of the machine name?  In my situation, it would be helpful to know
> both.  For example, if a user logs in at the machine across the hall and
> uses my DB, LDB Viewer will tell me WHERE the user is, but not necessarily
> WHO the user is.  I would like to know both.

> Here's the part of the original code that looks relevant to me:

> Option Compare Database
> Option Explicit

> 'You use the following constants with the LDBUser_GetUsers
> 'function's "nOptions" parameter below.
> Public Const OptAllLDBUsers = &H1
> Public Const OptLDBLoggedUsers = &H2
> Public Const OptLDBCorruptUsers = &H4
> Public Const OptLDBUserCount = &H8
> Public Const OptLDBUserAuthor = &HB0B

> Declare Function LDBUser_GetUsers Lib "MSLDBUSR.DLL" _
>   (lpszUserBuffer() As String, ByVal lpszFilename As String, _
>   ByVal nOptions As Long) As Integer

> Declare Function LDBUser_GetError Lib "MSLDBUSR.DLL" _
>   (ByVal nErrorNo As Long) As String _

> Function GetComputerNames(ByVal strMDB As String, _
>                           ByVal lngOptions As Long, _
>                           ByRef varArray As Variant) _
>                           As Integer

>     Dim intReturn As Integer

>     ReDim astrBuffer(1) As String

>     intReturn = LDBUser_GetUsers(astrBuffer, strMDB, lngOptions)

>     GetComputerNames = intReturn

>     If intReturn < 0 Then
>         varArray = LDBUser_GetError(intReturn)
>     Else
>         varArray = astrBuffer()
>     End If
> End Function



Mon, 21 Oct 2002 03:00:00 GMT  
 LDB Viewer -- Need to get NT user login name in addition to computer name
You can find it at:

http://support.microsoft.com/support/kb/articles/Q176/6/70.ASP

Steve

On Thu, 4 May 2000 17:32:19 -0500, "Joe Floeder"

Quote:

>I don't know the answer to yur question, however, if anyone of you could
>direct me to where I could get a copy of the MS LDB Viewer I would be very
>grateful



Mon, 21 Oct 2002 03:00:00 GMT  
 LDB Viewer -- Need to get NT user login name in addition to computer name
    I forgot exactly where, but I got it from the MS site.

--
Joe M
26 + 6 = 1  It's Irish math



Thu, 24 Oct 2002 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Getting NT Users LOGIN NAME?

2. Getting NT User Login Name

3. Getting the user's logon name and computer name

4. I need to get users NT Login Name

5. retreiving the computer login name and machine name

6. Getting Machine Name/Login Name

7. how to get NT login user name

8. Get the login name from a Wondows NT-User

9. Getting USers Login Name

10. Getting user LOGIN name from Windows?

11. Full user name from NT login ID

12. Help with getting the login name of the user who is blocking

 

 
Powered by phpBB® Forum Software