I cannot connect using values read from a config file.
This is on Windows, connecting to SQL Server 2008r2 on the same machine, using Python 3.6.
This works:
conn = p.connect(driver = '{SQL Server Native Client 11.0}', server = 'SERVERNAME',port = '1433',database = 'DATABASE',uid = 'USERNAME',pwd = 'PASSWORD')
I want to use a connect string from a config file using configParser and can do so successfully using pyodbc. However I cannot do so using turbodbc. The only way I can connect using turbodbc is either by DSN or the long format shown here (the allcaps are just placeholders, not variables).
The error that is always returned is:
"ODBC error state: IM010 native error code: 0 message: [Microsoft][ODBC Driver Manager] Data source name too long"
This is my first time using this package and it is great except for this problem.
Could be a noob issue, but it's confusing why connections work only by using variables within the code or a DSN. Makes writing the code awkward and not very dynamic for use in multiple environments (dev, test, prod). Connections vary by environment.