I need a Module to capture the Computer Name

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

MS Access 2000 Running on Win 2k OS

I need a module that I can call to display the Computer Name of the local machine. Thus far the 2 VB functions I have found on the web did not work.
 
This API call has been tested in Access VBA:
http://www.mvps.org/access/api/api0009.htm

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

MacAlf said:
MS Access 2000 Running on Win 2k OS.

I need a module that I can call to display the Computer Name of the local
machine. Thus far the 2 VB functions I have found on the web did not work.
 
I use the module that Allen refers to in a small sample database on my
website called "AuditTrail" and it works for me.

--
--Roger Carlson
www.rogersaccesslibrary.com
Reply to: Roger dot Carlson at Spectrum-Health dot Org

MacAlf said:
MS Access 2000 Running on Win 2k OS.

I need a module that I can call to display the Computer Name of the local
machine. Thus far the 2 VB functions I have found on the web did not work.
 
Did you place the function into a standard mocule, with the declarations at
the top? Works here in any version from A95 onwards.

I did not follow the logic of, "If I can't get any API calls to work, the
problem must be with the API calls." That's kinda like, "If I can't get any
brand of petrol to start my car engine, the problem must be with the
petrol."

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

MacAlf said:
Unfortunately that is one of the two that does not work. When I call
it, I get an error (Undifined function 'FOSMachinename" in expression.
 
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)

Tis should work

MacAlf said:
MS Access 2000 Running on Win 2k OS.

I need a module that I can call to display the Computer Name of the local
machine. Thus far the 2 VB functions I have found on the web did not work.
 
Back
Top