Jump to content

How to get list of ODBC DSNs?


 Share

Recommended Posts

This is really just a General Help Topic, not GUI related.

They can be found in the registry.

Entries stored here are string values of Data Source names

HKLM\Software\ODBC\ODBC.INI\ODBC Data Sources\

Entries stored here are parameters for data source

HKLM\Software\ODBC\ODBC.INI\{data source name}

#include <Array.au3>

$keyidx = 0
$regroot = "HKLM\Software\ODBC\ODBC.INI\ODBC Data Sources"
Dim $arrDSNs[1]

While 1
    $keyIdx += 1
    $keyName = RegEnumVal($regRoot, $keyIdx)
    If @error = 0 Then
        _ArrayAdd($arrDSNs,$keyName)
    Else
        ExitLoop
    EndIf
WEnd

$arrDSNs[0] = UBound($arrDSNs) - 1
_ArrayDisplay($arrDSNs)
Edited by spudw2k
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...