This works fine while trying to connect to sql server on localhost:
I have created a new sql server dns configuration on "COMPUTER1" (networked computer) with the same name "sqlserver" and I want to connect to that computer. So my question is how do I change the above code to connect to a dns name "sqlserver" on COMPUTER1? I've tried this:
But no luck, I get this error msg:
"Warning: odbc_connect() [function.odbc-connect]: SQL error: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified, SQL state IM002 in SQLConnect in C:\ on line 5"
P.S i'm using Apache2 and PHP by the way...
T.I.A!
Code:
$dsn="sqlserver";
$username="sa";
$password="";
$sqlconnect=odbc_connect($dsn,$username,$password);
Code:
$dsn="COMPUTER1/sqlserver";
$username="sa";
$password="";
$sqlconnect=odbc_connect($dsn,$username,$password);
"Warning: odbc_connect() [function.odbc-connect]: SQL error: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified, SQL state IM002 in SQLConnect in C:\ on line 5"
P.S i'm using Apache2 and PHP by the way...
T.I.A!