I am created two stringList BookmarkedFields and BookmarkedRecord
BookmarkedFields it contains column name of the dataset
BookmarkedRecord it like field:fieldValue
field is column name from BookmarkedFields
fieldValue is value according to column
Here is procedure to stored the record in the stringList as column and column's value for record.
procedure TBkmrgString.GetIQBookmark(ADataset: TDataset);
var
I : integer;
begin
ADataset.GetFieldNames(BookmarkedFields);
for I := 0 to BookmarkedFields.Count - 1 do
begin
BookmarkedRecord.AddObject(BookmarkedFields[I], ADataset.FieldByName(BookmarkedFields[I]));
end;
end;
I try to find that record already stored in stringlist into the dataset. But when start locating into dataset the value in stringlist automatically gets change and it shows the value which is pointed in dataset. Object of stringlist which is automatically get changed.
procedure TBkmrgString.GotoIQBookmark(ADataset: TDataset);
var
I : Integer;
a : string;
begin
ADataset.DisableControls;
ADataset.First;
while not ADataset.Eof do
begin
I := 0;
while (I < BookmarkedFields.Count) and
(ADataset.FieldByName(BookmarkedFields[ I ]).Value = TField(BookmarkedRecord.Objects[ I ]).Value) do
begin
I := I + 1;
end;
if I = BookmarkedFields.Count then
Break
else
ADataset.Next;
end;
ADataset.EnableControls;
end;
How to tackle from this situation, How did I persists the value in stringlist that stored, Don't want to be automatically changed object of stringlist.
Viewand if I am usingBookmarkafter closing and reopening the dataset bookmark gets invalid so That's why I am try to locate manualy.