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

CUid

Status
Not open for further replies.

PerryG

Programmer
Aug 15, 2000
75
US
Is there anyway to capture the network computer user id from within Access 97. If that doesn't work, can I get the computer name?

Thanks in advance.

Perry
 
put this in a module

Option Compare Database
Option Explicit

Private Declare Function GetComputerName Lib "kernel32" Alias "GetComputerNameA" (ByVal lpBuffer As String, nSize As Long) As Long

Public Function TestPcName()
Dim lpBuffer As String, nDummy As Long, nSize As Long
nSize = 255
lpBuffer = Space$(nSize)
nDummy = GetComputerName(lpBuffer, nSize)
Debug.Print Left(lpBuffer, nSize)
End Function


PaulF
 
Hi Perry,
by the network computer user id do you mean the username of the person logged onto the computer? If so then follow this:
You'll find loads of useful api calls on this website the above link points to the page for getting usernames.

If that isn't what you want then you maybe able to find what you want eslewhere on that site. Otherwise the following points to the page for getting the computername.

Before you use any of the code from this site you should read the copyright info at:
I hope this helps,
Richard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top