Subject Re: [IBO] TIBOQuery AfterScroll + recordCount problem (not BDE)
Author William Hill
from the posts on 24/11/2000

----- Original Message -----
> Sounds like I need to look into this.
> I'll log it as a potential bug.
>
>----- Original Message -----
>From: "William Hill" <william@...>
>To: <ibobjects@egroups.com>
>Sent: Friday, November 24, 2000 6:08 AM
>Subject: [IBO] TIBOQuery AfterScroll problem
>
>Greetings,
>
>I have just converted from BDE to IBO evaluation version 3.6 and am having
>a problem with TIBOQuery AfterScroll using master detail relationships.
>
>Under BDE when i scroll the master i get an AfterScroll event on the detail
>query each time, under IBO i only get an AfterScroll event once when i
> first open the detail query. Note the detail query will only select one
> row at a time (master and detail are same table).
>
>Is this expected ?, I have code running in the AfterScroll event which
>would be difficult to move elsewhere. All this is running on Win 98,
>Delphi 5 professional and IB V6.1. Can anyone help me with this..
>
>Regards, William.


Jason,

Thank you for your interest in this matter. I have been doing some more
testing and evaluation over the past few days and I am having other
afterScroll and also recordCount problems where IBO does not
give the same functionality as the BDE.

I have multiple TIBOQuery components connected to DBGrids which use the
afterScroll event to update Label captions indicating information about the
current row to the user. I use this technique extensively throughout my
application and so it is very important to me. Under the BDE when I open
or scroll a TQuery an afterScroll event is fired. I then test the passed
TDataSet object using the .isEmpty method to see if any rows are available
and from this I can clear the labels or update from the data in the current
row. I notice that if I open a TIBOQuery which has an empty result
set the afterScroll event does not fire ?, so my user interface is broken
(the Label captions contain information from the previous afterScroll
event).

I also use recordCount extensively, my users like to know how many records
there are and they are used to accurate information. I use a parameterized
TIBOQuery with >= :startstamp and <= :finishstamp input parameters.
The first time I open the query the recordCount is correct, but if I close
the query, change the parameter values and reopen the query the
recordCount stays the same ?. Experimentation gives me a correct
recordCount each time I change the parameters if I unprepare
and then prepare the IBOQuery (very inefficient) or if I use the IBOQuery.
InvalidateSQL method. (I noticed two gentlemen from Denmark discussing
the recordCount problem earlier this evening, this may help them).

I have recently upgraded from Interbase 5 to IB V6.1 (SQLDialect 1) and I
wish to leverage maximum functionality and performance from this
implementation. The application I am converting is too large and
complicated for a straight BDE -> IBO BDE replacement -> pure IBO
conversion.
Although converting to IB Objects has fixed some nasty problems
(which could not be fixed under the BDE) I now find myself confounded once
again.

Of course, it is possible that I am using poor coding style, or I
misunderstand the correct usage of the IBO functionality.
If this is so please correct me immediately, but I need to get
away from the BDE with the minimum fuss as possible.

If I can provide further evidence or examples to support these problems then
please do not hesitate to let me know as I am prepared to do my very best
to resolve them.

Environment notes:-
IBO evaluation version 3.6
InterBase (Fire Bird) 6.1
Delphi 5 Professional
Win 98

Very best regards

William.