Re: go back to database record

Posted by webmaster Guido on November 30, 2010

In Reply to go back to database record posted by Jose C P15709 on November 29, 2010

: I have dbgrid that is connected to table. When user clicks on button, every record of table is updated with a value, of course at end last record is selected in grid. How can go back to original record? Table is DBF using BDE.

This can be done with a Delphi TBookMark object. Here's a Delphi source code example:

procedure TForm1.Button1Click(Sender: TObject);
  BookMark1: TBookMark;
  // Save original position:
  BookMark1:= Table1.GetBookmark;
  // Operations that change position in Table1
  // ...
  // Finally, return to original position:

This works for any kind of "dataset" (Table1 in this example), DBF as well as Paradox, ADO, etc...