Recently I'm trying to connect to a SQL Server though pyodbc but I'm having some troubles with the connection string. I already tried as suggested on this previous question: Pyodbc error Data source name not found and no default driver specified paradox, creating a .dsn file and trying to implement the procedure's output on the string, but stil get the same error message: ('IM002', '[IM002] [unixODBC][Driver Manager]Data source name not found, and no default driver specified (0) (SQLDriverConnect)')
This is what I'm doing so far:
conn = pyodbc.connect('DRIVER={ODBC Driver 13 for SQL Server};
'WSID={BRRIO-xxxx};'
'APP={Microsoft? Windows? Operating System};'
'Trusted_Connection=Yes;'
'SERVER=BRRIO-xxxxxxx;'
'Database=xxx_Data;'
'UID="xxxx";'
'PWD="xxxx";'
)
and this is what my .dsn file looks like:
DRIVER={ODBC Driver 13 for SQL Server};
WSID={BRRIO-xxxx};
APP={Microsoft? Windows? Operating System};
Trusted_Connection=Yes;
SERVER=BRRIO-xxxxxxx
Any help is really appreciated!
question from:
https://stackoverflow.com/questions/66047455/pyodbc-connection-string-isnt-working-data-source-name-not-found-and-no-defa 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…