如何判断Adoquery1.对应的记录是否是最后一条记录? 指令怎么写?

解决方案 »

  1.   

    if  ADOQuery1.Eof then
    ShowMessage('是最后一条记录了');
      

  2.   

    ADOQuery1.Last
    直接指向最后一条记录
      

  3.   

    Eof属性的帮助:Indicates whether a dataset is positioned at the last record.Delphi syntax:property Eof: Boolean;C++ syntax:__property bool Eof = {read=FEof, nodefault};DescriptionTest Eof (end-of-file) to determine if the active record in a dataset is the last record. If Eof is true, the current record is unequivocally the last row in the dataset. Eof is true when an application:Opens an empty dataset.
    Calls a dataset抯 Last method. (Unless it is a unidirectional dataset)
    Call a dataset抯 Next method, and the method fails because the current record is already the last row in the dataset.
    Calls SetRange on an empty range or dataset.Eof is false in all other cases.Tip: If both Eof and Bof are true, the dataset or range is empty.
    ---------------------------------------------------------
    if (not ADOQuery1.IsEmpty) and (ADOQuery1.Eof) then