ADOQuery1.Recordcount>0;
或者:
 not ADOQuery1.IsEmpty

解决方案 »

  1.   

    adoquery.recordcount>0;

    adoquery.open;
    adoquery.first;
    adoquery.eof=false;
      

  2.   

    最好不要用recordcount,可以用isnull,count(*)等.否则可能有bug(delphi)
      

  3.   

    while adoquery1.eof do
    begin
    ……
    end;
    或者
    if isempty(table1) 
    ……
      

  4.   

    好像上面的 方法都不行啊!!当我输入正确的 信息时,总是说输入部队,是不是我的判断豫具有问题,还是其他的??
    我的 代码小小的改了一下 begin  //1
     ss1:=PassWordDlg.UserName.Text;
     ss2:=PassWordDlg.Password.Text;
     with  ADOQuery1 do   begin //2
      Close;
      SQL.clear;
      SQL.Add('select * from password ');
      SQL.Add('where username='''+ss1+''' and password='''+ss2+'''');
      //if ADOQuery1.Prepared=false then ADOQuery1.Prepare;
      Open;
      if Recordcount>0或是其他的 方法 then
      begin
     CmpTimes:=100;???????????
     end
     else
     begin//3
      CmpTimes:=CmpTimes+1;
      if CmpTimes>3 then
      MainForm.Close
      else
      messageDlg('密码错误,请重新输入,一共三次机会!',mtWarning,[mbOk],0);
     end;//3
     end;//2
      end //1