0

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

5
  • are you sure the Database name is correct (have you tried adding the file extension)? Commented Sep 22, 2014 at 10:27
  • Thanks for your reply. Yes the database name is correct. Commented Sep 22, 2014 at 10:33
  • does your SQL server require username/password access? But does sound like your database isn't found/inaccessible/corrupt/etc Commented Sep 22, 2014 at 10:35
  • Yes database needs username and password. I am able to access database using sqlcmd using same DSN. Commented Sep 22, 2014 at 10:40
  • or could be smething like this missing: stackoverflow.com/a/11162549/3913686 Commented Sep 22, 2014 at 10:43

1 Answer 1

0

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.