RE: [PHP-DB] ODBC
| From: | Beverly Steiner | Date: | Fri, 07 Mar 2003 20:41:13 +0000 |
| Subject: | RE: [PHP-DB] ODBC | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-26179@lists.php.net to get a copy of this message | ||
No, that won't work. You need to create a system DSN. Here's what I did to
create one. My PC is running Windows XP Professional and I am using Apache
1.3.27.
* opened up the control panel
* double-clicked Administrative Tools
* double-clicked Data Sources (ODBC)
* clicked on the System DSN tab
* clicked Add...
* selected Microsoft Access Driver (*.mdb) from the list
* clicked Finish
* typed mctadb in Data Source Name
* clicked on Select...
* selected the MS Access database I wanted to connect to and clicked OK
* clicked on Advance...
* typed in a Login name then clicked OK
* clicked OK in the next 2 windows
I could use some help as well. I get connected to the database but get an
error when I try to execute a SQL statement on it.
The error message I get is:
Warning: odbc_exec(): supplied argument is not a valid ODBC-Link resource in
c:\program files\apache group\apache\htdocs\test2.php on line 30
cannot prepare result
Does anyone know what might be missing? Here's the code from test2.php:
$connection = odbc_connect("mctadb", "admin", "") || die("cannot
open
database");
$sql = "SELECT * FROM Meeting";
$result = odbc_exec($connection, $sql) || die("cannot prepare result");
----------------------
Beverly Steiner
steiner277@charter.net
-----Original Message-----
From: Kiswa [mailto:Kiswa@telia.com]
Sent: Friday, March 07, 2003 3:24 PM
To: php-db@lists.php.net
Subject: [PHP-DB] ODBC
Hi.
Is their anyway to connect to a Access Db using only the filesystem like
$connect = odbc_connect("\Db\Webdb.mdb", "nobody", "nobody");
thus pointing directly to the file not using drivers???
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php