1. if qrytem. isempty = true then qrytem. recno: =-1; // minimum value: when the data source is opened and the data record set is null. If not empty, recno: = 1;
2. If qrytem. EOF = true then qrytem. recno: = qrytem. recordcount; // maximum value (the data source is not empty)
// When recno = qrytem. recordcount points to the last record, you can execute qrytem. Next again; then qrytem. EOF is true, and the recno value remains unchanged
3. // All qrytem. Close; qrytem. Open; this statement sets the current record position to the beginning of the record set, or the first record. You do not need to execute the qrytem. First Statement.
Qrytem. Open; qrytem. First; // This statement is always true, that is, when the initial record exists and the recno =-1 is not empty, the recno = 1;
Qrytem. Open; If qrytem. bof then // This statement is always true, that is, when the initial record exists and the recno =-1 is not empty, the recno = 1;
Eg: // Delphi7 qrytem: tadoquery;
If qrytem. isempty = false then // use the recno attribute to locate the record location
Begin
R: = qrytem. recno;
Qrytem. Close; qrytem. open;
If r <= qrytem. recordcount then qrytem. recno: = R;
End;
4. When multiple tables are queried in the left join mode, the required values are displayed. If you modify the value of one of the tables, an error is returned when refresh is used to refresh the table?
In this case, you can use requery (); then you can locate the current record again?