How to determine the name of local computer

D

Danny

I'd like to track changes to a database by inserting the
computer name (the machine's identity name, e.g., that is
returned as "System Name" via the "Set" command at the DOS
prompt on Windows XP) in any record via the afterupdate
event. How can I retrieve this information?

Thanks in advance.

Danny
 
P

Phil Hunt

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

Dim buf As String * 1024
Dim bufLen As Long
bufLen = 1024
Call GetComputerName(buf, bufLen)
msgbox Left(buf, bufLen)
 
Top