Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

obdc_connect()

Status
Not open for further replies.

brownfox

Programmer
Jan 5, 2003
173
0
0
GB
This works fine while trying to connect to sql server on localhost:
Code:
$dsn="sqlserver";
$username="sa";
$password="";
$sqlconnect=odbc_connect($dsn,$username,$password);
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:
Code:
$dsn="COMPUTER1/sqlserver";
$username="sa";
$password="";
$sqlconnect=odbc_connect($dsn,$username,$password);
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!
 
Unfortunately none of those helped as I'm using PHP not asp, but thanks anyway!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top