title: Connecting to SQL Server 2012 using sqlalchemy and pyodbc
body: <p>I'm trying to connect to a SQL Server 2012 database using SQLAlchemy (with pyodbc) on Python 3.3 (Windows 7-64-bit).  I am able to connect using straight pyodbc but have been unsuccessful at connecting using SQLAlchemy.  I have dsn file setup for the database access.</p>
  
  <p>I successfully connect using straight pyodbc like this:</p>
  
  <pre><code>con = pyodbc.connect('FILEDSN=c:\\users\\me\\mydbserver.dsn')
  </code></pre>
  
  <p>For sqlalchemy I have tried:</p>
  
  <pre><code>import sqlalchemy as sa
  engine = sa.create_engine('mssql+pyodbc://c/users/me/mydbserver.dsn/mydbname')
  </code></pre>
  
  <p>The <code>create_engine</code> method doesn't actually set up the connection and succeeds, but
  iIf I try something that causes sqlalchemy to actually setup the connection (like <code>engine.table_names()</code>), it takes a while but then returns this error:</p>
  
  <p><code>DBAPIError: (Error) ('08001', '[08001] [Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does not exist or access denied. (17) (SQLDriverConnect)') None None</code></p>
  
  <p>I'm not sure where thing are going wrong are how to see what connection string is actually being passed to pyodbc by sqlalchemy.  I have successfully using the same sqlalchemy classes with SQLite and MySQL.</p>
  
  <p>Thanks in advance!</p>