Set bookmark in database

Posted in Databases

Bookmark provides a convenient way to mark a location in a dataset so that an application can easily return to that location quickly. You need to use Bookmark property of Table component only.

var
  MyPoint: TBookmarkStr;
...
// Set bookmark
procedure TForm1.Button1Click(Sender: TObject);
begin
  MyPoint:=Table1.Bookmark;
end;

// Go to the bookmark
procedure TForm1.Button2Click(Sender: TObject);
begin
  Table1.Bookmark:=MyPoint;
end;

// Delete bookmark
procedure TForm1.Button3Click(Sender: TObject);
begin
  MyPoint:='';
end;