如何判断adoquery中字段值是不是空值?

if   not   adoquery1.FieldByName('translator').IsNull   then  
DataSet.FieldByName(FieldName).IsNull  
  DataSet.Fields[FieldIndex].IsNull  

一般情况用FieldByName('translator').asstring好,会自动将空值转成''空字符串.

不要图方便用FieldValues['...']; 有时会报错:could not convert variant of type (Null) into type
(string).

posted on 2009-04-10 01:26  歪歪Weblog  阅读(656)  评论(0编辑  收藏  举报

导航