briintex1
03-29-2004, 03:47 PM
My code is below
<?
//connect to a DSN "Admin" with a user "" and password ""
$connect = odbc_connect ("admin", "", "") or die("I cannot connect");
//query the test table
$query = "select * from studentinfo";
//perform the query
$result=odbc_exec($connect, $query);
//fetch the data from the database
while (odbc_fetch_row($result))
{
$name=odbc_result($result, 1);
print ("StudentID");
}
//close the odbc drive
odbc_close($connect);
?>
I have an error and can not figure out what the problem is, and was wondering if someone might be able to help
odbc_connect(): SQL error: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified, SQL state IM002 in SQLConnect in <b>c:\inetpub\wwwroot\murf systems\TMP2aycovcgyd.php</b> on line <b>3</b><br />
I cannot connect
I have the odbc set up but do not have a password...with it I am tryin' to run the web site on my computer also if that matters?
Thanks for the help in advance
<?
//connect to a DSN "Admin" with a user "" and password ""
$connect = odbc_connect ("admin", "", "") or die("I cannot connect");
//query the test table
$query = "select * from studentinfo";
//perform the query
$result=odbc_exec($connect, $query);
//fetch the data from the database
while (odbc_fetch_row($result))
{
$name=odbc_result($result, 1);
print ("StudentID");
}
//close the odbc drive
odbc_close($connect);
?>
I have an error and can not figure out what the problem is, and was wondering if someone might be able to help
odbc_connect(): SQL error: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified, SQL state IM002 in SQLConnect in <b>c:\inetpub\wwwroot\murf systems\TMP2aycovcgyd.php</b> on line <b>3</b><br />
I cannot connect
I have the odbc set up but do not have a password...with it I am tryin' to run the web site on my computer also if that matters?
Thanks for the help in advance