Re: RE: ADO Com and PHP4

From: Date: Wed, 04 Oct 2000 17:57:33 +0000
Subject: Re: RE: ADO Com and PHP4
Groups: php.windows 
Request: Send a blank email to php-windows+get-2936@lists.php.net to get a copy of this message
Just a little hint: PHP3 and PHP4 has build in support for ODBC. Why add extra overhead in using com objects to handle this communication ? I havent testet it but I would imagine a higher performence when using the ODBC functions directly ! - Frank P.S. COM support can still be used for all the objects not in PHP ! >Yes, the ADODB.Recordset object doesn't seem to work yet. Try the direct >approach using only the >ADODB.Connection object, like: > >$dbc = new COM("ADODB.Connection"); > $dbc->Provider = "MSDASQL"; #ODBC connection > $dbc->Open("your_DSN"); > $rs = $dbc->Execute("SELECT * FROM nhrpch.dbo.tblOrganizations WHERE >StreetState = 'TN'"; > > $i = 0; > while (!$rs->EOF) { > $i += 1; > $fld0 = $rs->Fields("yourfieldname1"); > $fld1 = $rs->Fields("yourfieldname2"); > $fld5 = $rs->Fields(5); # here a field number > print "$fld0->value $fld1->value $fld5->value<BR>"; > $rs->MoveNext(); > } > $rs->Close(); > >This should work also with an SQLOLEDB connection, but I can't confirm it, >as I'm not rich enough to own an m$sql db ;) >Also check with John Lims' site for his ADODB database at: >http://php.weblogs.com/ > >Good luck! > >Alain > Message from Alain Samoun >alain@samoun.com >HEAR ME>> http://pagoo.com/signature/alain > > >-----Original Message----- >From: jimmy.daresta@lcca.com [mailto:jimmy.daresta@lcca.com] >Sent: Wednesday, October 04, 2000 7:35 AM >To: alain@samoun.com >Subject: ADO Com and PHP4 > > >Hi. I caught your article on PHP Builder about using com with PHP4. I >decided after reading it that I would try it with ADO. Here is what I have >for code; > ><? > >$test = new COM("ADODB.Connection"); > >$rstest = new COM("ADODB.Recordset"); > >$test->ConnectionString = "Provider=SQLOLEDB;UID=nhrpch;PWD=joeyg;Initial >Catalog=nhrpch;Data Source=ESAU"; >$test->Open; > >$SQL = "SELECT * FROM nhrpch.dbo.tblOrganizations WHERE StreetState = 'TN'"; > >$rstest->ActiveConnection = "DRIVER={SQL >Server};UID=nhrpch;PWD=joeyg;Initial Catalog=nhrpch;Data Source=ESAU"; >$rstest->Source = $SQL; > >$rstest->Open; > >echo $rstest->Fields(0); >?> > >All works fine until the Field retrieval. For some reason it hangs at the >field retrieval. I have checked my db connect and so on and it all works >fine from what I can tell. > >I just wondering if you have ever successfully called ADO from within PHP4. >If so, is my syntax correct? > >My system btw is PHP 4.02, cgi method (the dll version caused problems for >some reason) and MSSQL Server 7. Thanks! > >>From IP Address: 205.173.240.115 >>From Browser: Mozilla/4.0 (compatible; MSIE 5.01; Windows NT) > > >-- >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 > > >

« previous php.windows (#2936) next »