Results 1 to 2 of 2

Thread: How to List DSN on Local Machine ?

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 1999
    Location
    South Africa
    Posts
    5

    Unhappy

    Is there a way that I can LIST and retrieve the attributes of all ODBC Datasource Names on the local machine from a VB app, and possibly the DSN's on a remote machine ?

    Any pointers?

    Thanks

    Gregorius

  2. #2
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844
    this will list all ODBC DSN & driver info
    Code:
    'uses [ODBC DRIVER & DATA SOURCE NAMES AND FUNCTIONS] library
        
        'lists all ODBC Drivers
        'lists all DSNs
        
        Dim objDSN As ODBCTool.Dsn
        Dim strDriverArray() As String
        Dim strDSArray() As String
        Dim I As Long
        
        Set objDSN = New Dsn
        
        objDSN.GetOdbcDriverList strDriverArray()
        objDSN.GetDataSourceList strDSArray()
        
        'list drivers
        For I = LBound(strDriverArray) To UBound(strDriverArray)
            Debug.Print strDriverArray(I)
        Next I
        
        'list dsns
        For I = LBound(strDSArray) To UBound(strDSArray)
            Debug.Print strDSArray(I)
        Next I
    as far as getting the attributes of each one, you'll probably have to become friendly with the ODBC API....

    Tom

Posting Permissions

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



Click Here to Expand Forum to Full Width