title: Error connecting to MS Access database with pyodbc in Python
body: <p>Having trouble connecting to a MS Access database using pyodbc. I think I know what's causing the problem, I'm just not sure how to fix it.</p>
  
  <p>I'm using 64 bit Access, 64 bit Python and my system is 64 bit. Here's my code:</p>
  
  <pre><code>cnxn = pyodbc.connect(r'DRIVER={Microsoft Access Driver (*.mdb, *.accdb)};DBQ="c:/temp/data.mdb;')
  </code></pre>
  
  <p>Which produces the error:</p>
  
  <pre><code>Error: ('IM002', '[IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified (0) (SQLDriverConnect)')
  </code></pre>
  
  <p>I think the reason for this has to do with the fact that (for whatever reason) when I go into my driver administrator (control panel -> system and security -> administrative tools -> Data Sources (ODBC)), it's looking in my <strong>C:\Windows\System32</strong> folder when it should be looking in my <strong>C:\Windows\SysWOW64</strong> folder. I dont have a working access driver in my \system32 folder, so it gives me an error.</p>
  
  <p><strong>Question: How can I get pyodbc to look into my C:\Windows\SysWOW64 folder, which has the Access driver I'm looking for?</strong></p>
  
  <p>Similar to what happens when I go into the control panel to get to my driver administrator, pyodbc seems to be defaulting to the \system32 folder when it should be looking for the driver in the \systwow64 folder.</p>