PEAR DB and ODBC
| From: | Andrej Snedic | Date: | Mon, 20 Oct 2003 14:29:19 +0000 |
| Subject: | PEAR DB and ODBC | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-8495@lists.php.net to get a copy of this message | ||
Hello there...
I don't seem to be able to make a valid DSN for an ODBC data source.
I have an ODBC data source named: TestOne.
Using DB::connect, I have tried
DB::connect("odbc:///TestOne")
DB::connect("odbc://user:password/TestOne")
DB::connect("odbc://user:password@localhost/TestOne")
DB::connect("odbc://localhost/TestOne")
and several other variations and all I get is "DB Error: connect failed"
Is there some special rules govering ODBC?
I've tried a connect to MySQL using connect("mysql://user:password@localhost/test")
and that connects fine, so I know the pear db is working.
Code:
--------------
$db_object = DB::connect('odbc://odbc://user:password/TestOne', TRUE);
if(DB::isError($db_object)) {
die("Connection: " . $db_object->getMessage());
}
--------------
Thanks,
-Andrej