An issue while connecting to the MS SQL Server

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

An issue while connecting to the MS SQL Server

Joseph boshra
Hello Brain

I'm Joseph a developer 

I have a project where I need to connect to the MS SQL from Linux so after searching I found that I need to install 
1- unixODBC
2- unixODBC
3- freetds-dev
4- freetds-bin
5- freetds-common
6- tdsodbc

and here is my configuration 

/etc/odbcinst.ini

[FreeTDS]
Description = ODBC for MSSQL
Driver = /usr/lib/x86_64-linux-gnu/odbc/libtdsodbc.so
Setup = /usr/lib/x86_64-linux-gnu/odbc/libtdsS.so
UsageCount = 1
Fileusage = 1
Threading = 2

/etc/odbc.ini

[MSSQL]
Description  = MSSQL Database
Driver = FreeTDS
Database = asterisk
Server = 192.168.14.193
Username = sa
Password = iti
Trace = no
TDS_Version = 8.0
Port = 1433

when I use this statement

echo "select 1" | isql -v MSSQL

I got

[s1000][unixODBC][FreeTDS][SQL Server]Unable to connect to data source
[s1000][unixODBC][FreeTDS][SQL Server]Login failed for user ''.
[ISQL]ERROR: Could not SQLConnect

but when I used this echo "select 1" | isql -v MSSQL sa iti it worked

I also Modified Freetds.conf

/etc/freetds/freetds.conf

[MSSQL]
Server = 192.168.14.193
TDS_Version = 8.0
Port = 1433

the question  is, why isql failed to connect to SQL Server and was not able to read the user name and password from the odbc.ini file ? and what is the solution for this problem ?
Thanks in advance
Best Regards,
Joseph

_______________________________________________
unixODBC-dev mailing list
[hidden email]
http://mailman.unixodbc.org/mailman/listinfo/unixodbc-dev