problem accessing MS Access DB
| From: | Beverly Steiner | Date: | Mon, 10 Mar 2003 21:36:57 +0000 |
| Subject: | problem accessing MS Access DB | ||
| Groups: | php.install | ||
| Request: | Send a blank email to php-install+get-10323@lists.php.net to get a copy of this message | ||
Hello,
I am having problems accessing an MS Access database through PHP and thought
maybe I missed something in the installation process. I set up a System DSN
for the database and went back and forth with a member of the PHP database
mailing list and he can't figure out why it isn't working.
I am running Windows XP, PHP 4.3.1, and Apache 1.3.27. After installing PHP
I copied php4ts.dll and php4apache.dll to my Windows/system32 folder. I
copied php-recommended.ini to the Windows folder, renamed it to php.ini and
edited the doc_roots line.
Here's my code:
$connection = odbc_connect("mctadb", "username", "") ||
die("cannot open
database");
$sql = "SELECT * FROM Meeting";
$result = odbc_exec($connection, $sql) || die("cannot prepare result");
I get the following error message in my browser:
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
What am I doing wrong?
----------------------
Beverly Steiner
steiner277@charter.net