我用adoquery利用sql查询怎样才能知道我没有找到记录那,我想做的是判断一下如果没有找到就出现一个提示框:没有要查找的数据。 有什么方法吗

解决方案 »

  1.   

    没找到记录那么adoquery的RecordCount为0撒
      

  2.   

    if adoquery1.fieldbyname('xx').isnull then
      

  3.   

    if adoquery.recordcount=0 then
      showmessage('没有找到记录');
      

  4.   

    if adoquery.IsEmpty then
      showmessage('没有找到记录');
      

  5.   

    if  adoquery1.eof and adoquery1.bof then 
        showmessage(' not found');
      

  6.   


    if adoquery.recordcount=0 then
      showmessage('没有找到记录');
      

  7.   

    if adoquery.eof and adoquery.bof then 
       showmessage('not found');
      

  8.   

    if ADOQuery1.Recordcount < 1 then showmessage('没有找到记录');
      

  9.   

    if ADOQuery1.Recordcount < 1 then 
    Application.MessageBox('对不起,没有找到该记录,'系统提示',MB_OK+MB_ICONWARNING);
      

  10.   

    用Recordcount 来判断可能会不准确的吧。用isEmpty保险
      

  11.   

    ADOQuery1.Recordcount < 1