Search notes:

Finding OLE DB providers

With VBS

The following VBS script tries to locate OLE DB providers based on the presence of the OLEDB_SERVICES value under a HKCR\CLSID class id. (See Registry CLSID key for OLE DB providers)
option explicit

const HKEY_CLASSES_ROOT     = &H80000000

dim registry
set registry = getObject("winmgmts:\\.\root\default:StdRegProv")

dim allCLSIDs
registry.enumKey HKEY_CLASSES_ROOT, "CLSID", allCLSIDs

dim clsid
for each clsid in allCLSIDs

    dim dummy
    dim clsidPath

    clsidPath = "CLSID\" & clsid
    if registry.getDWordValue(HKEY_CLASSES_ROOT, clsidPath ,  "OLEDB_SERVICES",     dummy) = 0 or _
       registry.getDWordValue(HKEY_CLASSES_ROOT, clsidPath & "\OLEDB_SERVICES", "", dummy) = 0    _
    then

        dim providerName
        dim progId
        dim progIdNoVersion
        dim oleDbProvider

        registry.GetStringValue HKEY_CLASSES_ROOT, clsidPath                              , "", providerName  ' Default value
        registry.getStringValue HKEY_CLASSES_ROOT, clsidPath & "\OLE DB Provider"         , "", oleDbProvider ' Default value
        registry.getStringValue HKEY_CLASSES_ROOT, clsidPath & "\ProgID"                  , "", progId        ' Default value
        registry.GetStringValue HKEY_CLASSES_ROOT, clsidPath & "\VersionIndependentProgID", "", progIdNoVersion

        wscript.echo providerName
        wscript.echo "  progId  : " & progId  & " / " & progIdNoVersion
        wscript.echo "  Provider: " & oleDbProvider
        wscript.echo "  CLSID   : " & CLSID

        wscript.echo
    end if
next
Github repository about-OLE-DB, path: /provider/find-with.vbs

With PowerShell

The following PowerShell script uses the the static method GetRootEnumerator of System.Data.OleDb.OleDbEnumerator to iterate over OLE DB Providers.
foreach ($provider in [System.Data.OleDb.OleDbEnumerator]::GetRootEnumerator()) {

   "{0,-30} {1,-55} {2} {3} {4,-30}" -f
      $provider['sources_name'       ] ,
      $provider['sources_description'] ,
      $provider['sources_clsid'      ] ,
    # $provider['sources_parsename'  ] ,
      $provider['sources_type'       ] ,
      $provider['sources_isparent'   ]
}
Github repository about-OLE-DB, path: /provider/find-with.ps1

See also

A C# example that iterates over System.Data.OleDb.OleDbEnumerator is here.

Index