pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Hélder M. Vieira <hmv@mail.telepac.pt>
To: pgsql-odbc@postgresql.org
Subject: Re: 8.1.1.0, VB6, RDO, rdoResultset.RowCount
Date: Thu, 10 Nov 2005 02:16:48 -0000
Message-ID: <009201c5e59c$d0147e30$580bfea9@hmv02> (raw)
References: <000a01c5e593$0651bb20$580bfea9@hmv02>
	<0d5901c5e594$5eb44480$0201a8c0@iwing>

> this was discussed earlier today i think...
>
> the recordset has an EOF (end of file) flag. if rs.EOF equals False, then 
> there are rows in the resultset.


Thanks and yes, EOF is indeed a much cleaner way for early testing of a
potentially empty resultset.
But now I have another disturbing situation, that came up during EOF
tests...
If I have a non-empty resultset, traveling all the way (using MoveNext)
until EOF is found doesn't produce a valid RowCount.
Only a MoveLast seems to do the job.

I created a five rows / two columns table, opened a 'select *' resultset and
performed the following sequence:

   With ordoRs
      .MoveFirst
      While Not .EOF
         Debug.Print .rdoColumns("f1"), .rdoColumns("f2"), .RowCount ' <----  
RowCount is always equal to 0
         .MoveNext
      Wend
      .MoveLast
      Debug.Print , , .RowCount ' <---- RowCount is correct
   End With

This seems somewhat dangerous to me, although I must say I never made a
similar test with any ODBC driver (as far as I can remember, I always used
MoveLast to get an accurate RowCount).


Helder M. Vieira





view thread (4+ messages)  latest in thread

Message-ID: <009201c5e59c$d0147e30$580bfea9@hmv02>
Permalink:  ../009201c5e59c$d0147e30$580bfea9@hmv02/
Also on:    postgresql.org/message-id/009201c5e59c$d0147e30$580bfea9@hmv02

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-odbc@postgresql.org
  Cc: hmv@mail.telepac.pt
  Subject: Re: 8.1.1.0, VB6, RDO, rdoResultset.RowCount
  In-Reply-To: <009201c5e59c$d0147e30$580bfea9@hmv02>
  References: <000a01c5e593$0651bb20$580bfea9@hmv02> <0d5901c5e594$5eb44480$0201a8c0@iwing> <009201c5e59c$d0147e30$580bfea9@hmv02>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox