pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Re: VB6 and RowCount fix
5+ messages / 4 participants
[nested] [flat]

* Re: VB6 and RowCount fix
@ 2005-12-18 01:06  Ludek Finstrle <luf@pzkagis.cz>
  0 siblings, 0 replies; 5+ messages in thread

From: Ludek Finstrle @ 2005-12-18 01:06 UTC (permalink / raw)
  To: Dave Page <dpage@vale-housing.co.uk>; +Cc: pgsql-odbc

> > > > > Interestingly, this doesn't seem to fix the VB6 rowcount 
> > > > issue which I
> > > > > still see as -1.
> > > > 
> > > > Please could you send me compiled VB6 example?
> > > 
> > > Attached. You'll need vb6 runtimes of course, as well as MDAC 2.6 or
> > > above.
> > 
> > This example doesn't work even againist old version of psqlodbc.
> > With Parse Statement on the old driver return error:
> > Operation is not allowed when the object is closed.
> > With Parse Statement off the old driver return -1
> > 
> > Are you sure this example is right?
> 
> It reproduces the issue correctly, however I don't recall whether or not
> Recordset.RowCount worked in old versions of the driver in the first
> place. It may well have been broken before.

I disagree. I try your example even againist MS SQL and it still returns
-1. The test suite for VB6 RowCount you sent me doesn't work at all.

Please is someone in the list who can create minimalistic application
in VB6 which test if psqlODBC 08.01.0104 handles RowCount correctly?

Thanks,

Luf



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: VB6 and RowCount fix
@ 2005-12-18 16:23  Dave Page <dpage@vale-housing.co.uk>
  0 siblings, 1 reply; 5+ messages in thread

From: Dave Page @ 2005-12-18 16:23 UTC (permalink / raw)
  To: Ludek Finstrle <luf@pzkagis.cz>; +Cc: pgsql-odbc




-----Original Message-----
From: Ludek Finstrle [mailto:luf@pzkagis.cz]
Sent: Sun 12/18/2005 1:06 AM
To: Dave Page
Cc: pgsql-odbc@postgresql.org
Subject: Re: [ODBC] VB6 and RowCount fix
 
> I disagree. I try your example even againist MS SQL and it still returns
> -1. The test suite for VB6 RowCount you sent me doesn't work at all.

The test app works perfectly well - look at the source code; all it does is report the value from ADODB.Recordset.RowCount. What is not clear, is whether that ever worked for any data provider. I always use the "while not rs.EOF..." approach when I wrote VB code in the past.

Regards, Dave




^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: VB6 and RowCount fix
@ 2005-12-18 19:48  Ludek Finstrle <luf@pzkagis.cz>
  parent: Dave Page <dpage@vale-housing.co.uk>
  0 siblings, 2 replies; 5+ messages in thread

From: Ludek Finstrle @ 2005-12-18 19:48 UTC (permalink / raw)
  To: Dave Page <dpage@vale-housing.co.uk>; +Cc: pgsql-odbc

> > I disagree. I try your example even againist MS SQL and it still returns
> > -1. The test suite for VB6 RowCount you sent me doesn't work at all.
> 
> The test app works perfectly well - look at the source code; all it does

I took a look at t source code. But I don't know VB.

> is report the value from ADODB.Recordset.RowCount. What is not clear,
> is whether that ever worked for any data provider. I always use the
> "while not rs.EOF..." approach when I wrote VB code in the past.

I think the question is how VB get RowCount value. It seems to me that
VB counts it internaly from fetched rows.

I close this chapter now if noone proof the opposite.

Regards,

Luf



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: VB6 and RowCount fix
@ 2005-12-18 20:51  Campbell, Greg <greg.campbell@us.michelin.com>
  parent: Ludek Finstrle <luf@pzkagis.cz>
  1 sibling, 0 replies; 5+ messages in thread

From: Campbell, Greg @ 2005-12-18 20:51 UTC (permalink / raw)
  To: Ludek Finstrle <luf@pzkagis.cz>; +Cc: Dave Page <dpage@vale-housing.co.uk>; pgsql-odbc

I am coming late to this thread.
The issue for RowCount is not in VB, but always in ADO regardless of language, although the overwhelming 
majority  is in VB.
The key to rs.RowCount behaviour is the type of recordset cursor you are opening.
For example
rs.CursorLocation = adUseClient
rs.Open conn, sql, adOpenStatic
debug.print rs.RowCount

will pull all the records into a client side recordset.
while

rs.CursorLocation = adUseServer
rs.Open conn, sql, adOpenForwardOnly
debug.print rs.RowCount

will attempt to open a server side cursor,
When first opened the recordset will NOT know how many rows there are (rs.RowCount = -1).
You have to iterate through a server side or ForwardOnly cursor to get a recordcount. The count may not be 
accurate until the end of the recordset.

For small recordset, clearly the client side processing is better.
For large sets, like table access to millions of records, I am not sure on what is the best approach. I 
typically try to redefine the approach, in those situations. I make everything I can a detached client 
side recordset.


I am unclear on what calls the ADO will make to the ODBC driver, and if DECLARE/FETCH will be triggered 
based on the pgodbc setup.

The only thing that should reliable in any case is rs.EOF.

I have not seen your sample VB code, but things like this make a huge difference. Again, I am late in 
having this thread grab my attention. If my remarks are off-base, please ignore then and forgive me.






Ludek Finstrle wrote:
>>>I disagree. I try your example even againist MS SQL and it still returns
>>>-1. The test suite for VB6 RowCount you sent me doesn't work at all.
>>
>>The test app works perfectly well - look at the source code; all it does
> 
> 
> I took a look at t source code. But I don't know VB.
> 
> 
>>is report the value from ADODB.Recordset.RowCount. What is not clear,
>>is whether that ever worked for any data provider. I always use the
>>"while not rs.EOF..." approach when I wrote VB code in the past.
> 
> 
> I think the question is how VB get RowCount value. It seems to me that
> VB counts it internaly from fetched rows.
> 
> I close this chapter now if noone proof the opposite.
> 
> Regards,
> 
> Luf
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 9: In versions below 8.0, the planner will ignore your desire to
>        choose an index scan if your joining column's datatypes do not
>        match

Attachments:

greg.campbell.vcf (text/x-vcard, 239B) download begin:vcard fn:Greg Campbell n:Campbell;Greg org:Michelin North America - US5 Lexington;ENG-ASE email;internet:greg.campbell@us.michelin.com title:ASE Systems Engineer tel;work:803-951-5561/x75561 x-mozilla-html:FALSE version:2.1 end:vcard
^ permalink raw reply [nested|flat] 5+ messages in thread

* Re: VB6 and RowCount fix
@ 2005-12-19 02:11  Hélder M. Vieira <hmv@mail.telepac.pt>
  parent: Ludek Finstrle <luf@pzkagis.cz>
  1 sibling, 0 replies; 5+ messages in thread

From: Hélder M. Vieira @ 2005-12-19 02:11 UTC (permalink / raw)
  To: pgsql-odbc

> I think the question is how VB get RowCount value. It seems to me that
> VB counts it internaly from fetched rows.




^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2005-12-19 02:11 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-12-18 01:06 Re: VB6 and RowCount fix Ludek Finstrle <luf@pzkagis.cz>
2005-12-18 16:23 Re: VB6 and RowCount fix Dave Page <dpage@vale-housing.co.uk>
2005-12-18 19:48 ` Ludek Finstrle <luf@pzkagis.cz>
2005-12-18 20:51   ` Campbell, Greg <greg.campbell@us.michelin.com>
2005-12-19 02:11   ` Hélder M. Vieira <hmv@mail.telepac.pt>

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