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)
 

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