也就是说在 输入后怎么查重复记录呢?
用什么语句,怎么写?

解决方案 »

  1.   

    adoquery.close;
    adoquery.sql.add('select * from table1 where id='''+edit.text+'''');
    adoquery.open
    if adoquery.recordcount>=0 then
       begin
          showmessage('记录已经存在');
       end;
      

  2.   

    adoquery.close;
    adoquery.sql.add('select * from (select distinct(id) As id, count(1) As ShuLiang from table1 ) aa where shuliang >1 ');
    adoquery.open
      

  3.   

    我的方法
      adoquery1.close;
      adoquery1.sql.clear;
      adoquery1.sql.add('select * from yourtable where yourfield = '+edit.text+'');
      if adoquery1.recordcount>1 then 
       showmessage('数据重复!');