[AccessD] New version of Environ("computername")?

Jurgen Welz jwelz at hotmail.com
Thu Oct 30 13:05:44 CDT 2008


I remember Seth Galitzer posting something about how unreliable or flakey environment variables are.  At one point he had a demo of use of them at his university web page.  He backed off on these.
 
Private Declare Function GetComputerNameA Lib "kernel32" (ByVal lpBuffer As String, lngSize As Long) As Long
Public Function fnComputerName() As String
    On Error Resume Next
 
    Dim strRet As String * 256
    Static strComputer As String
    If Len(strComputer) Then
        fnComputerName = strComputer
    Else
        If GetComputerNameA(strRet, Len(strRet)) <> 0 Then
            strComputer = Left$(strRet, InStr(1, strRet, vbNullChar) - 1)
            fnComputerName = strComputer
        End If
    End If
End FunctionCiaoJürgen WelzEdmonton, Albertajwelz at hotmail.com> From: ssharkins at gmail.com> To: AccessD at databaseadvisors.com> Date: Thu, 30 Oct 2008 13:11:14 -0400> Subject: [AccessD] New version of Environ("computername")?> > Environ("username") and Application.UserName are equivalent, but I can't > find anything similar for Environ("computername") -- is there an Application > equivalent?> > Is there a preference?> > Susan H. > > -- > AccessD mailing list> AccessD at databaseadvisors.com> http://databaseadvisors.com/mailman/listinfo/accessd> Website: http://www.databaseadvisors.com
_________________________________________________________________




More information about the AccessD mailing list