Subject Bookmarks
Author Robert martin
Hi All

I am having performance problems with the following code using an IBOQuery component. Can anybody see something obvious I am doing wrong (worked great with the BDE unfortunately).



var
MyBookmark : TBookMark;
EntityRef : Integer;
Counter : Integer;
begin
Result := True;
EntityRef := -1;

with zClientOrderStatusDM.OrderInQuery do begin
DisableControls;
MyBookMark := GetBookmark;
try

Counter := 0;
while (Counter < OrdersDBGrid.SelectedRows.Count)
and (Result = True) do begin
GotoBookmark(Pointer(OrdersDBGrid.SelectedRows.Items[Counter]));

if (EntityRef = -1) then begin
//First instance of client
EntityRef := FieldByName('EntityRef').AsInteger;
end
else if (EntityRef <> FieldByName('EntityRef').AsInteger) then begin
//Row Select for another client
Result := False;
end;
Inc(Counter);
end;
finally
GotoBookmark(MyBookMark);
FreeBookmark(MyBookMark);
EnableControls;
end;
end;




Rob Martin
Software Engineer

phone 03 377 0495
fax 03 377 0496
web www.chreos.com

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