Subject refresh and bookmark problem
Author Laurent GILBERT
Hi all,

I’ve a little problem with bookmark and TIBOQuery.

I’ve two windows which contain a TIBOQuery on the same table.
I operate in the same transaction.

In first window, TIBOQuery has a filter on a single field.

In second window, I edit a record, modify a single field and post it
(CachedUpdates = false). This modification results in exclude the current
record of the filter in the first window.
After I call ApplyUpdates in second window, I do a refresh of the first
window.

I’ve a general purpose procedure :

procedure pu_ibrefresh(vaIBDataSet_ds : TIBODataSet);
var
vlBookMark_pos_courante : TBookMark;
begin
with vaIBDataSet_ds
do begin
try
vlBookMark_pos_courante := GetBookmark;
Refresh;
if BookmarkValid(vlBookMark_pos_courante)
then

GotoBookmark(vlBookMark_pos_courante);
finally
FreeBookmark(vlBookMark_pos_courante);
End;
end;
end;

I use Bookmark to keep current position if possible.

The problem is that an TdataSet error occurs : “RECORD NOT FOUND”.

Stack view shows :

DatabaseError(‘Enregistrement non trouve’) // Record not found
TdataSet.Resync([rmExact.rmCenter])
TIBODataset. Resync([rmExact.rmCenter])
TdataSet.GotoBookmark(???)
Pu_refresh($1D11678)

Bookmark seems to be not valid even after its validation with BookmarkValid.

If somebody gets an idea….

Regards,

Laurent GILBERT.







[Non-text portions of this message have been removed]