Issue with Connecting to MS SQL

Oswin Dsa <[email protected]>
Newsgroups gmane.comp.db.tds.freetds
Message-ID <MA1PR01MB03735CA4C6ADA3396E0AACC289860@MA1PR01MB0373.INDPRD01.PROD.OUTLOOK.COM>
Hello,

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 it's 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

Few searches online I found that if SERVER attribute is used in connection string then freetds.config and odbc.ini are ignored. So I guess the config file parameters don't help much.

Also to add a point this works for most of the environment expect a few,  is there any way to find why those few are not able to connect ?



Could anyone please provide me with some pointers or any help so I can proceed further.

Regards,

Oswin

________________________________

http://www.mindtree.com/email/disclaimer.html
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.