GetBookmark and Record not found !
Posted: Fri 28 Jan 2011 16:08
Hello,
I use an old procedure to refresh a query without lose current record position :
But with IBDAC I got sometime an error "Record not found".
In line "GotoBookmark(BookMk);".
I think the problem come from master/slave relationship which change between :
Change TibDatasetOptions.options.detailDelay:=100 seems to work better but that happen is the windows/computer is very very slow ?
Does it exists a better method to refresh a TCustomIBCDataSet without lose current record ? Or what to fix in my procedure RefreshQuery ?
Best regards,
I use an old procedure to refresh a query without lose current record position :
Code: Select all
procedure RefreshQuery(Query: TDataSet;StorePos:boolean=true);
var
BookMk: TBookmark;
OldState:boolean;
begin
if not (Query is TdxMemData) then
begin
OldState:=Query.active;
try
with Query do
begin
//DisableControls;
try
if Active and StorePos and not isempty then
begin
BookMk := GetBookmark;
end
else BookMk := nil;
try
Close;
Open;
//SetToBookmark(Query, BookMk);
if BookMknil then
begin
try
GotoBookmark(BookMk);
except
end;
end;
finally
if BookMk nil then
begin
FreeBookmark(BookMk);
end;
end;
finally
//EnableControls;
end;
end;
except
Query.active:=OldState;
end;
end;
end;
But with IBDAC I got sometime an error "Record not found".
In line "GotoBookmark(BookMk);".
I think the problem come from master/slave relationship which change between :
Code: Select all
Close;
Open;
Change TibDatasetOptions.options.detailDelay:=100 seems to work better but that happen is the windows/computer is very very slow ?
Does it exists a better method to refresh a TCustomIBCDataSet without lose current record ? Or what to fix in my procedure RefreshQuery ?
Best regards,