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!

Determining username

Status
Not open for further replies.

merwyns

Instructor
Oct 14, 2002
1
US
I have some students that want to create an Access application (with a DB2 backend) that will automatically determine the network login of the user, enforce security within the application, and automatically fill in a "last maintenance" field with the username. Of course they don't want the user to have to log in to the application, they want it to be done automatically. To the best of my knowledge, this is not possible. If anyone out there has any hints or advice, I would most certainly appreciate it.

Merrie
 
See if this will help you...

Code:
Private Declare Function getComputerName _
   Lib "kernel32" Alias "GetComputerNameA" _
   (ByVal sBuffer As String, lSize As Long) As Long

Public Function f_computerName()
    Dim PCName As String
    NameOfPC PCName
    f_computerName = PCName
End Function

Public Function NameOfPC(MachineName As String) As Long
    Dim NameSize As Long
    Dim x As Long
    MachineName = Space$(16)
    NameSize = Len(MachineName)
    getComputerName MachineName, NameSize
End Function
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top