title: How to get name of ODBC driver's DLL file for a given ODBC driver
body: <p>How do I programatically get the name of an ODBC driver's DLL file for a given ODBC driver. For example, given "SQL Server Native Client 10.0" I want to find the name of that driver's DLL file: sqlncli10.dll. I can see this in REGEDIT in the "Driver" entry in the registry under HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI. If I try to read the value from the registry in my code it returns an empty string. I also tried using the ODBC API function SQLDrivers. The code below successfully returns all the values of the attributes in the Attribs variable except "Driver". Everything is there - APILevel, ConnectFunctions, CPTimeout, etc - but "Driver" is not in the list. </p>
  
  <pre><code>repeat
    Status := SQLDrivers (HENV, SQL_FETCH_NEXT, PAnsiChar(DriverName), 255,
              NameLen, PAnsiChar(Attribs), 1024, AttrLen);
    if Status = 0 then begin
      List.Add(DriverName);
      List.Add(Attribs);
    end;
  until Status &lt;&gt; 0;
  </code></pre>