title: Connect Python with SQL Server Database
body: <p>When I am trying to connect python with SQL Server, following error occurred.</p>
  
  <blockquote>
    <p>"pyodbc.Error: ('08001', '[08001] [Microsoft][ODBC SQL Server
    Driver][DBNETLIB]SQL Server does not exist or access denied. (17)
    (SQLDriverConnect)')"</p>
  </blockquote>
  
  <p>Following is the my code.</p>
  
  <pre><code>import pyodbc
  connection = pyodbc.connect("Driver={SQL Server}; Server=localhost;          
  Database=emotionDetection; uid=uname ;pwd=pw;Trusted_Connection=yes")
  cursor = connection.cursor()
  SQLCommand = ("INSERT INTO emotion"  "(happy, sad, angry) "
            "VALUES (?,?,?)")
  Values = ['smile','cry','blame']
  cursor.execute(SQLCommand,Values)
  connection.commit()
  connection.close()
  </code></pre>
  
  <p>This is my first attempt to connect <strong>Python with sql server</strong>. I don't have an idea what would be the driver name, server name, username and password.Do you have any idea of what should be my configuration. Please help me.</p>