while not table1.Eof do
         begin
           if
             table1.FieldByName('stu_num').Value=edit20.Text
           then
            begin
             messagedlg(' Ñ§Ô±±àÂëÖظ´£¬ÇëÖØÐÂÊäÈë',mtconfirmation,[mbOK],0);
             break;
            end
           else
             next;
         end;

解决方案 »

  1.   

    ...
    ...
    else
      table1.next;
      

  2.   

    我在上面有with table1 do
      

  3.   

    如果你的if 条件满足   就会进入死循环,你的不管if成立与否,你都要进行next才行
    你自己在看看就知道了还有你的代码写的太不规范了----------!!!!!!!!
      

  4.   

    语句在你的WITH 中吗
    把上面的TABLE1去掉,能否运行,编译就知道了
      

  5.   

    我来帮你整理一下代码:如下:
    with Table1 do
       while (not eof) do
       begin
         if trim(FieldByName('stu_num').Asstring)=trim(edit20.Text) then
         begin
            messagedlg([message_string],mtconfirmation,[mbOK],0);     
            break;
         end else next;
       end;
      

  6.   

    不好意思,才发现你的messagedlg中,如果是消息提示用mtinformation 不是询问mtconfirmation