0
votes

I'm looking at a SQL Server connection string. It looks like this:

Data Source=xxxxxxxx;Initial Catalog=xxxxxxxx;Provider=SQLNCLI11.1;Integrated Security=SSPI

My question is: how is the provider name (in general) mapped to a specific DLL or library?

Here's a second example (for Oracle):

Data Source=xxxxxxxx;User ID=xxxxxxxx;Provider=OraOLEDB.Oracle.1;Persist Security Info=True;

Same question. How do I get from the provider name to the dll or library where the code is?

1
What are you really trying to accomplish here? These are not the types of libraries you can edit.Sean Lange
I really want to know how a name like SQLNCLI11.1 is resolved to a particular DLL. I don't want to edit it, just identify it.user1443098
But why do you care? This is all managed in the framework so you don't have to worry about it. The path changes based on where you installed the dotnet framework and the version. This is really just something you should accept that it works. Or is there some actual reason you are trying to figure out the actual dll?Sean Lange
Most of all, curiosity, piqued because I noticed that, when using a cstring generated by VS 2017 for Oracle in an SSIS package on a new box with VS 2019 that the provider was not found. After installing the MS' new preview provider for Oracle, it still wasn't found. Comparing provider names generated by both versions, I can see that they don't match. If I can understand the mapping of provider name to DLL, I can see what is missing.user1443098

1 Answers

1
votes

the dll path is stored in inprocserver32 of the provider (GUID) in the registry (HKEY_CLASSES\CLSID)

foreach ($provider in [System.Data.OleDb.OleDbEnumerator]::GetRootEnumerator())
{
    $v = New-Object PSObject        
    for ($i = 0; $i -lt $provider.FieldCount; $i++) 
    {
        Add-Member -in $v NoteProperty $provider.GetName($i) $provider.GetValue($i)
    }
    $reg = Get-ItemProperty "Registry::HKEY_CLASSES_ROOT\CLSID\$($v.SOURCES_CLSID)\InprocServer32" -ErrorAction SilentlyContinue
    Add-Member -in $v "Dll path" $reg.'(default)'

    $v
}