ADO Tools

From AutoIt Wiki
Revision as of 10:31, 9 January 2014 by Rt01 (talk | contribs)
Jump to navigation Jump to search

List all installed OLE DB providers

#include <Array.au3>
Global $sOutput, $oRegistry, $oKey, $sKey = "HKCR\CLSID", $iIndexReg = 1, $iIndexResult = 0
Global $aResult[200][3]
While 1
    $sSubKey = RegEnumKey($sKey, $iIndexReg)
    If @error Then ExitLoop
    $sKeyValue = RegRead($sKey & "\" & $sSubKey, "OLEDB_SERVICES")
    If @error = 0 Then
        $aResult[$iIndexResult][0] = $sKey & "\" & $sSubKey
        $aResult[$iIndexResult][1] = RegRead($sKey & "\" & $sSubKey, "")
        $aResult[$iIndexResult][2] = RegRead($sKey & "\" & $sSubKey & "\OLE DB Provider", "")
        $iIndexResult = $iIndexResult + 1
    EndIf
    $iIndexReg = $iIndexReg + 1
WEnd
ReDim $aResult[$iIndexResult][3]
_ArrayDisplay($aResult, "OLE DB Providers", "", 0, Default, "Registry key|OLE DB Provider|Description")

Result:

OLE DB Providers