I've followed all the steps from this link: https://code.google.com/p/pypyodbc/wiki/Linux_ODBC_in_3_steps
But I'm still getting this error:
[unixODBC][Driver Manager] Data source name not found, and no default driver specified
Then when I started researching more, I found this: https://askubuntu.com/questions/167491/connecting-ms-sql-using-freetds-and-unixodbc-isql-no-default-driver-specified
Now it says to modify odbc.ini file to include the server and database name. But if I'm trying to connect to multiple servers at the same time, how should I configure odbc.ini file in this case?
Also - in my database connection string, should I enter the driver name as {SQL Server} or {FreeTDS}?
Here's an example set up with FreeTDS, unixODBC, and friends:
freetds.conf:
[server1]
host = one.server.com
port = 1433
tds version = 7.3
[server2]
host = two.server.com
port = 1433
tds version = 7.3
odbc.ini:
[server1]
Driver = FreeTDS
Server = one.server.com
Port = 1433
TDS_Version = 7.3
[server2]
Driver = FreeTDS
Server = two.server.com
Port = 1433
TDS_Version = 7.3
odbcinst.ini:
[FreeTDS]
Description = FreeTDS with Protocol up to 7.3
Driver = /usr/lib64/libtdsodbc.so.0
The Driver =
location may differ above, depending on your distro of FreeTDS.
pyodbc connect, DSN free:
DRIVER={FreeTDS};SERVER=one.server.com;PORT=1433;DATABASE=dbname;UID=dbuser;PWD=dbpassword;TDS_Version=7.3;
A few notes:
See here for more:
https://msdn.microsoft.com/en-us/library/dd339982.aspx
Good luck.