Bug #18253 Updated: ADO Function Execute() doesn't return right amount of affected rows
| From: | mkools at euronet dot nl | Date: | Tue, 09 Jul 2002 23:11:13 +0000 |
| Subject: | Bug #18253 Updated: ADO Function Execute() doesn't return right amount of affected rows | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-13660@lists.php.net to get a copy of this message | ||
ID: 18253
Updated by: mkools@euronet.nl
Reported By: mkools@euronet.nl
Status: Open
Bug Type: COM related
Operating System: Windows 2000 Pro SP2
PHP Version: 4.2.1
New Comment:
Forgot this in the original post: The queries itself do seem to work
fine, so it's only the affectedrows which isn't working.
Previous Comments:
------------------------------------------------------------------------
[2002-07-09 19:09:42] mkools@euronet.nl
I'm currently in the process of writing a wrapper class to connect
through ADO with an MS Access database. The whole class works, except
for one thing: I can't get the amound of affected records of an insert,
update or delete statement.
What I have now is this:
$Vrows = new VARIANT( 0, VT_I4|VT_BYREF);
$this->QueryResult = @$this->Link->Execute( $inQuery, $Vrows);
$this->AffectedRows = $Vrows->value;
Explaination: QueryResult will be my RecordSet, Link is the ADO
Connection object, inQuery is the query itself and AffectedRows will
hold the amount of affected records by the query.
But this seems to return the value 7779424 in all cases (even with
select statements).
The second things I've tried is:
$this->QueryResult = @$this->Link->Execute( $inQuery,
&$this->AffectedRows);
But that doesn't do anything with the AffectedRows variable. It keeps
holding the value of what I put in it previously (I default it to -1).
Is this a bug, or am I doing things totally wrong? I found the latter
syntax on some other places on the web, so either those aren't working
either or I'm forgetting something...
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=18253&edit=1