Re: Hi,I have an idea of no DSN to use access,but i faild.
| From: | Christine Green | Date: | Fri, 08 Sep 2000 01:54:00 +0000 |
| Subject: | Re: Hi,I have an idea of no DSN to use access,but i faild. | ||
| References: | 1 2 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-2517@lists.php.net to get a copy of this message | ||
Thank you !
But i got error as :
Warning: Invoke() failed: in F:\php\program\ado\access.php on line 4
Warning: Invoke() failed: in F:\php\program\ado\access.php on line 7
My php code is:
<?
$connString =
"Provider=Microsoft.Jet.OLEDB.4.0;DataSource=F:\\WINNT\\system32\\ias\\dnary.mdb";
$dbc = new COM("ADODB.Connection");
$dbc->Open($connString);
$sqlString = "SELECT * FROM Vendors";
$rs = new COM("ADODB.Recordset");
$rs->Open($sqlstring, $dbc, 3, 3);
?>
----- Original Message -----
From: "David Coulter" <david@luminarytech.com>
To: "Christine Green" <christine19990815@163.net>
Sent: Thursday, September 07, 2000 10:58 PM
Subject: Re: [PHP-WIN] Hi,I have an idea of no DSN to use access,but i faild.
> Well, I'll take a shot at this... I know how to do it in ASP so this might
> work. :)
>
> <?
> $connString = "Provider=Microsoft.Jet.OLEDB.4.0;Data
> Source=d:\inetpub\wwwroot\news.mdb"
> $dbc = new COM("ADODB.Connection");
> $dbc->Open $connString
> $sqlString = "SELECT * FROM Vendors";
> $rs = new COM("ADODB.Recordset");
> $rs->Open $sqlstring, $dbc, 3, 3
> file://do whatever with the array of the recordset
> ?>
>
> Like I said though, this is what it looks like written in ASP, but with the
> PHP syntax. I could be totally off. Hope it helps though. :)
>
> David Coulter
>
> Christine Green wrote:
>
> > Hi all,i have an idea to use access and not config dsn,
> > but i don't know to how to do.
> > exa:
> > <?
> > $cnpath = "DBQ=F:\\WINNT\\system32\\ias\\dnary.mdb";
> > $driver = "DRIVER={Microsoft Access Driver (*.mdb)};";
> > $pr = $driver.$cnpath;
> >
> > $dbc = new COM("ADODB.Connection");
> > $dbc->Provider = $pr;
> > $dbc->Open("nwind");
> > $rs = $dbc->Execute("select * from Vendors");
> > ... ...
> >
> > ?>
> > But i get a error and the ie will close,
> > i don't know what cause that.
> >
> > Any advice ?
> >
> > Christine Green
> >
> > --
> > PHP Windows Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net
> > For additional commands, e-mail: php-windows-help@lists.php.net
> > To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>