[lazarus] ... TDBGrid interbase problems ...

Jesus Reyes jesusrmx at yahoo.com.mx
Sat May 31 19:27:58 EDT 2003



Sorry answering after so long time :), and sorry too because i can't
link to the original message thread:

>
> Though, I also like the idea of displaying only the data when
needed. But
I
> think we need help from you guys as to understanding why is it that
TDBGrid
> cannot scroll backwards specially for tables with more 10
records(at least
for
> Firebird. )
>
> Regards,
>
> Yoyong
>

Michael appointed after that message that 10 records is probably
related to the

Const
  DefaultBufferCount = 10;

defined in dataset.inc

this is right!. Now, TDBgrid actually can do backward/forward scroll.
what happen is that TIBQuery "Implementation" explicitly deny this,
take a look at the following code in TIBQuery.GetRecord:

...
  if FIsEOF then
    Result := grEOF
  else
  begin
    Result := grOK;
    case GetMode of
    ....
  end;
  if Result = grOK then
  begin
    with PIBBookmark(Buffer + FRecordSize)^ do
    begin
      BookmarkData := FCurrentRecord;
      BookmarkFlag := bfCurrent;
    end;
  end
  else if (Result = grError) then
    DatabaseError('No record');
end;

once TIbQuery reach EOF it can't fetch more records, you have a
number a buffers allocated in TDataset (10) beyond this limit
TIBQuery can't fetch previous records, so if you reach record 23, you
will not be able to backscroll before record 13 

TDataset buffer system is a cycled one and in this situation you can
see the buffers content cycling in the grid, this could be seen as an
error but I don't think it is so.

What can we do to get it working as it is, I'm affraid raising
artificially the TDataset.Buffercount by means of DbGrid's
FDatalink.Buffercount as Yoyong already done, until TIBQuery
implementation gets updated, maybe
FDataLink.BufferCount:=FDataLink.DataSet.RecordCount And updating on
trying to get the next record?

I hope this could be useful.

Regards.

Jesus Reyes A.

_________________________________________________________
Do You Yahoo!?
La mejor conexión a internet y 25MB extra a tu correo por $100 al mes. http://net.yahoo.com.mx






More information about the Lazarus mailing list