title: pyodbc connection to MS SQL Server running on a docker container
body: <p>pyodbc doesn't seem to be able to connect when trying to connect through specifying Driver. I am able to connect to setting up a DSN but I also want to make connection when user has got the Driver, Server, UID, PWD and Database details. </p>
  
  <p>I am on Mac and and using FreeTDS driver. </p>
  
  <p>freetds.conf </p>
  
  <pre><code>[MYMSSQL]
  host = 0.0.0.0
  port = 1433
  tds version = 7.3
  </code></pre>
  
  <p>odbcinst.ini</p>
  
  <pre><code>[FreeTDS]
  Description=FreeTDS Driver for Linux &amp; MSSQL
  Driver=/usr/local/lib/libtdsodbc.so
  Setup=/usr/local/lib/libtdsodbc.so
  UsageCount=10
  </code></pre>
  
  <p>Here is how I am trying to connect:</p>
  
  <pre><code>conn_str = "DRIVER=FreeTDS;SERVER={0};UID={1};PWD={2};DATABASE={3}".format('MYMSSQL', 'sa', 'password','tempdb')
  conn = pyodbc.connect(conn_str)
  </code></pre>
  
  <p>The error I get is this: </p>
  
  <pre><code>pyodbc.OperationalError: ('08001', '[08001] [FreeTDS][SQL Server]Unable to connect to data source (0) (SQLDriverConnect)')
  </code></pre>
  
  <p>Exact same database details work when I try to connect through DSN.  </p>