M.B.
M.B.

Reputation: 1082

Connecting to an MSSQL database through ODBC Error

Where to start..

php code:

<?
### Database    ###
$user = "*****"; //database user
$pass = "*****";    //database password
$host = "localhost";   //database location
$db = "test";     //database name
##mysql_connect ("$host","$user","$pass");
##mysql_select_db("$db");
$dbConn = odbc_connect("$db","$user","$pass","$host") or die(odbc_errormsg());
?>

The password and username are correct but the error still remains.

Any help is appreciated!

Upvotes: 0

Views: 10010

Answers (1)

Liam Sorsby
Liam Sorsby

Reputation: 2982

Have you set your datasource using administrative tools, data sources, System DSN?

if not i'm sure it won't find the database.

see this link: http://support.microsoft.com/kb/305599

Upvotes: 0

Related Questions