ADOQuery组建设为ltBatchOptimistic模式时,如何判断当前ADOQuery是否为空,或者某字段是否为空.

解决方案 »

  1.   

    adoquery1.fieldbyname('**').asstring='';
      

  2.   

    当adoquery1中没有数据时判断不出来的.他不一定是空字符串,可能是空值NULL来的
      

  3.   

    如果判断adoquery1中记录为空可以这样:       with adoquery1 do
               beign
                 close;
                 sql.clear;
                  sql.add('select * from tablename');
                 open;
               if recordcount=0 then showmessage('记录为空');
               end;
    如果判断字段为空: select * from tablename where 字段名 is null
      

  4.   

    我都说不是判断表中的数据啦,是adoquery的缓存中的数据啊