ya cna't do it, AFAIK. ADO doesn't like returning record counts. If you need
to know that badly, use select count(*) first.

sad but true :)

N
--
Nic Wise - 021.676.418 / [EMAIL PROTECTED] / Inprise/Borland New Zealand
Is it not a foolish man, said little Woo, who keeps all his chickens in his
trousers?
For at best, will he not suffocate his chickens, and, and worst, will he not
disappoint the ladies in the village?  --Alexi Sayle



----- Original Message -----
From: "Derricutt, Mark" <[EMAIL PROTECTED]>
To: "Multiple recipients of list database" <[EMAIL PROTECTED]>
Sent: Tuesday, March 14, 2000 5:09 PM
Subject: [DUG-DB]: ADO-DB Question - RecordCount...


> Whilst not related to Delphi, I was wondering if anyone here could answer
me
> this wee question, I have the following Perl code:
>
>   $Conn = CreateObject OLE "ADODB.Connection";
>   $Conn->Open($currentdb);
>   $sql = "SELECT ConfigurationID, StartDate FROM Configuration \
>           WHERE StartDate BETWEEN '$startdate 00:00:00' AND \
>           '$startdate 23:59:59'";
>   print $sql, "\n";
>   $rs = $Conn->Execute($sql);
>   $configchange = $Conn->RecordCount > 0;
>   print "RecordCount = ", $rs->RecordCount, "\n\n";
>
> The query when run returns 1 record (as shown in the query analyser when
the
> same query is run), however, $rs->RecordCount shows -1.  I remember awhile
> ago reading somewhere about problems with RecordCount and ADO (or maybe
that
> was Access?) but was wondering if anyone new anything about the the
> resultset object that the query returns, should I be looking at another
> property other than RecordCount?
>
> I could always fire another query with the same WHERE clause but with
> COUNT(*) instead of the columns, but if I could do with only one DB access
> I'd like to.
>
> BTW: Perl/ADO is kinda neat :)  Now if only I could figure out how to call
a
> perl function from my delphi app :)
>
> Mark
>
> --
> Mark Derricutt   "People in prayer for me, everyone there for me,
> ICQ: 1934853      sometimes I feel I should face this alone, my
> Wrk: 377-9941     soul exposed... it calm's me to know that I
> Fax: 377-9947     won't!" = Dream Theater - Scarred
> DDI: 375-3754
>
> Now Playing: Iced Earth - Reaping Stone
> --------------------------------------------------------------------------
-
>   New Zealand Delphi Users group - Database List - [EMAIL PROTECTED]
>                   Website: http://www.delphi.org.nz
>

---------------------------------------------------------------------------
  New Zealand Delphi Users group - Database List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to