...

View Full Version : an odbc_connect error



briintex1
03-29-2004, 04: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

PAUL HOOPER
05-21-2004, 09:37 PM
Go into control panel

ODBC Sources and setup a Entry in the 'System DSN' this should give you
access to the database .

Well at least for reading. If you successful in writing data back to the database please update my problem

sad69
05-21-2004, 09:41 PM
Came across this thread, may be of help:
http://bugs.php.net/bug.php?id=16812

Sadiq.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum