odbc_connect (PHP + MSSQL) problems

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Hi all,

I have tried connect to remote MS SQL  server with no success. Anyone
help me?

###this is the code used to try connect

$dsn = "Driver={SQL Server};Server=200.xxx.xxx.xxx;Database=Mydb;";
$user = 'WebService';
$pass = 'triad';

if(odbc_connect($dsn, $user, $pass)){
 echo "I got it!.";

###This is the error

Warning: odbc_connect() [function.odbc-connect]: SQL error:
[unixODBC][Driver Manager]Data source name not found, and no default
driver specified, SQL state IM002 in SQLConnect in
/home/triadbra/public_html/desenvolvimento/digs/teste2.php on line 8

anyone have any idea to solve this problem? i have a linux server with
PHP and a remote sql server

Re: odbc_connect (PHP + MSSQL) problems

Quoted text here. Click to load it

I suppose you have unixODBC installed and data source name configured
for Microsoft SQL Server? Next step is to tell PHP where it can find
your ODBC configuration file:


Also make sure that your web server has permission to read that file.


Site Timeline