Subject TIBOQUERY Problem
Author Andy Murphy
Hi,

I use the TIBODataset comps because i need connectivity with the standard
delphi TDatasource comp for a set of third party datagrids. (devExpress
QuantemGrid).

I have a problem with some strange behavour with the grid and I worried it
could be the underlying TIBOQuery that is doing something a bit weird. The
IBOQuery is set to read only as this is one big read-only database. Its an
Information system.

I set up the IBOquery in the usual way:

datasource.dataset.disablecontrols;
with IBOQuery1 do begin
close;
with sql do begin
clear;
add('select * from s2000 where s_date = :mdate);
end;
parambyname('mdate').asdate:=adatevar;
prepare;
open;
end;
datasource.dataset.enablecontrols;

ok thats fine. Depending on which of 7 dates are chosen the records will be
in the region of 15,000 records. You even have an option to select all
records (110,000). Now because this Query isnt set to fetch all, it brings
back the data almost instantly and displays it in my grid.

The problem is if you scroll down this dataset a while then switch it to
another date (i.e. another set of data) on about the second or third time,
the query takes like two minutes to come up and populate the grid.

Now by doing a simple button clicked
ShowMessage(inttostr(IBOQUERY1.recordcount)) I know that when it works
properly the count takes a while (dont worry i dont do this in the real app
i use a 'Select Count(*)' IBOQuery), but if the grid has hung around for a
minute, if i do a record count its instant even with 110,000 records. I.e
its loaded all the records to the client machine. Err this is very bad.

The people who make the grid cant seem to come up with anything, and I cant
replicate it using IBX, I also dont want to use IBX. Is there some way of
definitively reseting that TIBOQuery or the IBODatabase or IB_Connection ( I
dont mind which one i use) to make sure its definately free and not likely
to be comapring the previous dataset or loading all the records or doing
something else weird?

My bigger problem is I have the system on test with some of my customers and
whilst the rest of the App works great, they aint too happy about it
freezing for 3 minutes and pulling say 110,000 records across their network.

Since I have run out of options I would really appreciate any thought on
this whatsoever.

Thanks

Andy.