Search code examples
.netado.netoledbconnection-stringdatabase-connection

How are OLE DB connection strings mapped to DLLs?


How does the OleDbConnection constructor know what provider DLL (I assume it's a DLL) to call for a given provider name in the connection string? For example, in the following code...

string cnStr = "Provider=Sybase.ASEOLEDBProvider.2;Server Name=etc...";
OleDbConnection cn = new OleDbConnection(cnStr);

How does OleDbConnection know where to find Provider=Sybase.ASEOLEDBProvider.2?

I'm trying to debug a data access problem in my Winforms app and I think it may be related to a driver bug that's been fixed, so I may need to upgrade my DLL.


Solution

  • The mapping is done in the registry. For SQLOLEDB, I have a assembly location of %CommonProgramFiles%\System\Ole DB\sqloledb.dll under the appropriate class id.