title: Connect SQL Server to Python 3 with pyodbc
body: <pre><code>import pyodbc
  
  cnxn = pyodbc.connect('DRIVER={SQL Server Native Client 11.0};SERVER=LENOVO-PCN;DATABASE=testing;')
  
  cursor = cnxn.cursor()
  
  cursor.execute("select Sales from Store_Inf")
  row = cursor.fetchone() 
  if row: 
      print (row)
  </code></pre>
  
  <p>I try using python 3 with module pyodbc to connect SQL Server Express.
  My codes gave a error:</p>
  
  <blockquote>
    <p>('08001', '[08001] [Microsoft][SQL Server Native Client 11.0]Named
    Pipes Provider: Could not open a connection to SQL Server [2].  (2)
    (SQLDriverConnect)')</p>
  </blockquote>
  
  <p>Any idea for this?</p>