是对的,请看 Examine RecNo to determine the record number of the current record in the dataset. Applications might use this property with RecordCount to iterate through all the records in a dataset, though typically record iteration is handled with calls to First, Last, MoveBy, Next, and Prior.Note: If accessing Paradox tables, RecNo can be set to a specific record number to position the cursor on that record. 只有Paradox表才能起作用,其他数据库就不行了
用循环!Query1.Open; //Query1.First; if Not Query1.IsEmpty then While Not Query1.Eof do begin //写数据到PARADOX //PANQuery1.Insert; //PANQuery1.FieldByName('ID').Asstring := Query1.FieldByName('id').ASstring; //PANQuery1.FieldByName('Name').Asstring := Query1.FieldByName('Name').ASstring; //PANQuery1.APPLYUPDATES; //PANQuery1.CommitUpdates; Query1.Next; end;
Examine RecNo to determine the record number of the current record in the dataset. Applications might use this property with RecordCount to iterate through all the records in a dataset, though typically record iteration is handled with calls to First, Last, MoveBy, Next, and Prior.Note: If accessing Paradox tables, RecNo can be set to a specific record number to position the cursor on that record.
只有Paradox表才能起作用,其他数据库就不行了
多谢大虾
TABLE的RECNO还好一些!
//Query1.First;
if Not Query1.IsEmpty then
While Not Query1.Eof do
begin
//写数据到PARADOX
//PANQuery1.Insert;
//PANQuery1.FieldByName('ID').Asstring := Query1.FieldByName('id').ASstring;
//PANQuery1.FieldByName('Name').Asstring := Query1.FieldByName('Name').ASstring;
//PANQuery1.APPLYUPDATES;
//PANQuery1.CommitUpdates;
Query1.Next;
end;