0
votes

I am trying to connect my php application with SQL server in my Linux box. I installed unixODBC successfully and made required changes in odbc.ini and odbcinst.ini file.

When I run command.<br><b>sqlcmd -S DSN -U USERNAME -P Password</b>

I am able to connect to sql server, but when I tried to connect with same DSN using isql (isql -v DSN USERNAME PASSWORD)<br> I am gating Data source name not found exception.

content of my odbc.ini file is

[SPSQLDEV]
Driver = ODBC Driver 11 for SQL SERVER
server = *.com,portno
Database = TEST

content of odbcinst.ini is


[SQL SERVER Native Client 11.0]
Driver = /opt/microsoft/sqlncli/lib64/libsqlncli-11.0.so.1790.0
Threading = 1
Output of command odbcinst -q -d is.
SQL Server Native Client 11.0
out put of command odbcinst -q -s is
SPSQLDEV

1
are you sure the Database name is correct (have you tried adding the file extension)?user3913686
Thanks for your reply. Yes the database name is correct.Shrikant
does your SQL server require username/password access? But does sound like your database isn't found/inaccessible/corrupt/etcuser3913686
Yes database needs username and password. I am able to access database using sqlcmd using same DSN.Shrikant
or could be smething like this missing: stackoverflow.com/a/11162549/3913686user3913686

1 Answers

0
votes

On MacOS put your odbc.ini on /usr/local/etc/odbc.ini then run your isql command