I'm trying to connect to Microsoft SQL Server from my Mac application using iODBC and FreeTDS. No matter what I do, I get the error message Unable to connect to data source from the FreeTDS driver. i have consulted as many possible manuals, blog posts, and StackOverflow questions.
Following is the troubleshooting steps i tried and more details about my code,
DB Connection string = Driver=/Applications/xxx.app/Contents/Frameworks/libtdsodbc.so;Server=ip;DATABASE=DB;TDS_Version=8.0;Port=1433;ClientCharset=UTF-8;uid=username;pwd=*****;Trusted_Connection=No;
From application logs,
SQLGetDiagRec function returns
[01000] [FreeTDS][SQL Server]Adaptive Server connection failed (20002)
[08001] [FreeTDS][SQL Server]Unable to connect to data source (0)
Few StackOverflow post's suggested this is due to TDS version and changing to 8.0 would help but its already set.
When I ping the server - no packets are lost. Connection is established when i telnet the server on 1433 port.
Using the below i am able to establish connection too,
tsql -H >IP< -p 1433 -U username -P password
In this particular post as per the comments by Max Bolingbroke if SERVER attribute is used then freetds.config and odbc.ini are ignored. So i guess the config file parameters dont help much.
Could anyone please provide me with some pointers or any help so i can proceed further.