title: How to connect Python to Microsoft Access database file?
body: <p>I am trying to connect Python to a Microsoft Access database file, but I keep getting this error:</p>
  
  <blockquote>
    <p>64bit and Office 365 Business 64bit (Access).</p>
  </blockquote>
  
  <pre><code>conn = pyodbc.connect(r'Driver={Microsoft Access Driver (*.mdb, *.accdb)};DBQ=[path];')
  pyodbc.InterfaceError: ('IM002', '[IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified (0) (SQLDriverConnect)
  
  import pyodbc
  
  conn = pyodbc.connect(r'Driver={Microsoft Access Driver (*.mdb, *.accdb)};DBQ=[path];')
  cursor = conn.cursor()
  cursor.execute('select * from username_pw')
  
  for row in cursor.fetchall():
      print (row)
  </code></pre>