Delphi dbgrid row cannot be located for updating
Navigating through a dataset is done with the same set of methods as described in the "Behind data in datasets" chapter.
In general ADOQuery component should not be used when editing takes place.
At run-time, the parameters can be changed and the query re-executed to refresh the data.
In order to execute a parameterized query, it is necessary to supply a value for each parameter prior to the execution of the query.
The most common statement, however, is the SELECT statement, which produces a view similar to that available using a Table component.
The Get Table Names in the On Create event of the form fills the Combo Box with the table names and the Button is used to close the query and to recreate it to retrieve the records from a picked table. Button1Click(Sender: TObject); var tblname : string; begin if Combo Box1.
Locate(Second Row Id, 'Id', ) then begin Client Data Set1. Free Bookmark(Bookmark); end; finally Data Source1.
These SQL statements can either be DDL (Data Definition Language) statements such as CREATE TABLE, ALTER INDEX, and so forth, or they can be DML (Data Manipulation Language) statements, such as SELECT, UPDATE, and DELETE.
The SQL based queries are mostly used for reporting purposes.
If your query returns a result set, it is sometimes possible to edit the returned dataset.