Bug #18253: ADO Function Execute() doesn't return right amount of affected rows
| From: | mkools at euronet dot nl | Date: | Tue, 09 Jul 2002 23:09:43 +0000 |
| Subject: | Bug #18253: ADO Function Execute() doesn't return right amount of affected rows | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-13659@lists.php.net to get a copy of this message | ||
From: mkools@euronet.nl
Operating system: Windows 2000 Pro SP2
PHP version: 4.2.1
PHP Bug Type: COM related
Bug description: ADO Function Execute() doesn't return right amount of affected rows
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 bug report at http://bugs.php.net/?id=18253&edit=1
--
Fixed in CVS: http://bugs.php.net/fix.php?id=18253&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=18253&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=18253&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=18253&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=18253&r=support
Expected behavior: http://bugs.php.net/fix.php?id=18253&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=18253&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=18253&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=18253&r=globals