Connect MSSQL 2014 using python 3.4
<p>I'm trying to connect MSSQL 2014 database using python (3.4).</p>

<p>I installed the pypyodbc package.</p>

<pre><code>     import pypyodbc

     connection = pypyodbc.connect('DRIVER ={SQL Server};' 'SERVER = myserver;' 'UID=user;' 'PWD=password;' 'DATABASE = dbo.db')
</code></pre>

<p>When I tried this, I'm getting an error saying Data source name not found and no default driver specified.</p>

<p>Check which drivers are installed (in Powershell)</p>

<pre><code>Get-ItemProperty 'hklm:\SOFTWARE\ODBC\ODBCINST.INI\ODBC Drivers'
</code></pre>

<p>Also, Remove the spaces from 'SERVER = myServer' to make 'SERVER=myServer'. For me this works</p>

<pre><code>conn = pypyodbc.connect('Driver={SQL Server Native Client 11.0};Server=myhost;')
</code></pre>

python sql-server python-3.x