I have a query on a table. qryOne and tblOne. tblOne has a auto inc field called tblID.
qryOne fills a dbGrid. When I select a record in the dbGrid, how do I position the record pointer in the tblOne to the same record?
I can use Locate.tblID in Delphi but can I do the same with Sql?
Table pointer
-
AndreyZ
Re: Table pointer
Hello,
To locate a record in a dataset, you can use the FindKey or Locate methods. Here are code examples that demonstrate locating a record in a table using a record from a query:For more information about this methods, please read the Delphi help.
To locate a record in a dataset, you can use the FindKey or Locate methods. Here are code examples that demonstrate locating a record in a table using a record from a query:
Code: Select all
MyTable.FindKey([MyQuery.FieldByName('id').AsInteger]);Code: Select all
MyTable.Locate('id', MyQuery.FieldByName('id').AsInteger, []);