Re: Connecting to MS Access
| From: | David Robley | Date: | Thu, 13 Jun 2002 00:35:48 +0000 |
| Subject: | Re: Connecting to MS Access | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-19774@lists.php.net to get a copy of this message | ||
In article <20020612162345.89280.qmail@pb1.pair.com>, wbhk@unm.edu says...
> I am having problems connecting to an Access database. I am using Windows
> 2000, IIS 4, Access 2000, and PHP 4.2.1. I have created a system DSN using
> the Access (.mdb) driver, and have a username and password. What's going
> on?? Thanks, Bill
>
>
>
> The code I have used is as follows:
>
>
>
> ************************************************************************
>
>
>
> <?php
>
>
>
> //connect to database
>
> $connectionstring = odbc_connect("meteoritecatalog", "username",
> "password");
>
> //line 14 is immediately above
>
>
>
> //SQL Query
>
> $query = "SELECT sample, type FROM sample";
>
>
>
> //execute query
>
> $queryexe = odbc_do($connectionstring, $query);
>
> //line 20 above
>
>
>
> //output results to standard output
>
> odbc_result_all($queryexe, "BORDER=1");
>
> //line 23 above
Well, never used ODBC and Access, but shouldn't there be something
somewhere that defines the host on which the DSN may be found?
--
David Robley
Temporary Kiwi!
Quod subigo farinam