The file-based DSN string is being interpreted by SQLAlchemy as server name = c
, database name = users
.
I prefer connecting without using DSNs, it’s one less configuration task to deal with during code migrations.
This syntax works using Windows Authentication:
engine = sa.create_engine('mssql+pyodbc://server/database')
Or with SQL Authentication:
engine = sa.create_engine('mssql+pyodbc://user:password@server/database')
SQLAlchemy has a thorough explanation of the different connection string options here.