Is it possible to specify the driver dll directly in the ODBC connection string?
<p>I'm trying to use pyodbc to connect to a SQL Server (MS SQL Server through FreeTDS) in a portable application; since it's supposed to be standalone, I would like to avoid having to explicitly install the driver on the system, just bringing the ODBC driver dll along the application.</p>

<p><a href="http://old.vk.pp.ru/docs/sybase-any/interfaces/00000040.htm" rel="nofollow noreferrer">This page</a> suggests that it's possible to specify the driver dll directly in the connection string</p>

<blockquote>
  <ul>
  <li><p>Specify the <code>DRIVER=</code> parameter in the <code>szConnStrIn</code> argument to the <code>SQLDriverConnect</code> function. For example:</p>

<pre><code>szConnStrIn = "driver=ospath/dbodbc6.dll;dbf=c:\asademo.db"
</code></pre>
  
  <p>where <code>ospath</code> is the operating system subdirectory of your Adaptive Server Anywhere installation directory.</p></li>
  </ul>
</blockquote>

<p>Trying it through pyodbc+<code>libtdsodbc.so</code> on Linux, it does work fine; however, trying the same on Windows (pyodbc+<code>tdsodbc.dll</code>) I always get </p>

<blockquote>
  <p>pyodbc.Error: ('IM002', '[IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified (0) (SQLDriverConnect)')</p>
</blockquote>

<p>(my <code>libtdsodbc.so</code> seems to be fine, though, since, if I install it as a "regular" driver and refer it with its name it connects fine)</p>

<p>Checking <a href="https://msdn.microsoft.com/en-us/library/ms715433(v=vs.85).aspx" rel="nofollow noreferrer">the documentation of <code>SQLDriverConnect</code></a> and related pages there's no mention of the <code>DRIVER=</code> option used straight with the dll path.</p>

<p>So, isn't "straight-to-driver-dll" connection not supported on Windows? Are there any alternatives, especially with Python, to connect straight to the driver dll, bypassing the ODBC driver manager?</p>