title: How to open a SQL Server .mdf file with Python (pandas)
body: <p>I'm trying to open a mdf sql database file that I have saved to my desktop. How do you open it as a pandas dataframe? so far all I have is the following:</p>
  
  <pre><code>conn=pyodbc.connect(driver='{SQL Server}', dsn=filepath)
  </code></pre>
  
  <p>Its giving me the error message</p>
  
  <p>OperationalError: ('08001', '[08001] [Microsoft][ODBC SQL Server Driver]Neither DSN nor SERVER keyword supplied (0) (SQLDriverConnect)')</p>
  
  <p>I found another question that was similar but it was also unanswered. I have also been unable to find a good tutorial to start using sql databases with python I'm very new to the topic. Let me know if there is any extra information I can give. Thanks in advance.</p>