Results 1 to 6 of 6
  1. #1
    Join Date
    Jul 2002
    Location
    Billings, MT
    Posts
    29

    Unanswered: ADO and Network Information

    I am wondering if there is any way to use ADO code or a WinAPI call to get the name (ID) of a computer on a Windows 2000 Network. Any ideas or suggestions would be appreciated.

    Terry H

  2. #2
    Join Date
    Nov 2004
    Posts
    9
    Try Environ('COMPUTERNAME')

  3. #3
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    The environ function can do a lot more than just return the computer name. For example want to find the users netwrok logon in a Novell Environment? "nwusername", the curent users designated temp storage area "temp" or "tmp" - saves messing around with file dialogs. A word of caution always use the string (key) to retrieve the environment setting yiu want, the index is machine specific.

    Environ works with NT, XP, 2000, and (It think partially) 98/SE but not with 3 & 3.1 (& Mac?)

  4. #4
    Join Date
    Jul 2002
    Location
    Billings, MT
    Posts
    29

    ADO and Environ

    Thanks. The Environ function did just what I needed.
    Terry H

  5. #5
    Join Date
    Jul 2002
    Location
    Billings, MT
    Posts
    29

    Environ Function Paramters

    What other Parameters can be used with the Environ function (other than ComputerName, UserName, and Path)?

  6. #6
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    its machine dependant
    suggest you try a test form
    in the on load event place the follwoing code and examine the debug panel in the code window

    Private Sub Form_Load()
    Dim bytLoop As Byte, strEnviron As String
    For bytLoop = 1 To 255
    strEnviron = Environ(bytLoop)
    If Len(strEnviron) > 0 Then
    Debug.Print "Key:" & Environ(bytLoop)
    End If
    Next bytLoop
    End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •