如果用的是ado查询sql 可以直接写. select isnull(field,0) as field from table 或者 双击你的adoquery,or adotable ,table 添加所有的字段进来,选中你要设置的字段, 再 找到他的gettext事件 procedure TdmBasicMDForm.RecordStateGetText(Sender: TField; var Text: String; DisplayText: Boolean); begin if sender.isnull Then text:=0 end;
select isnull(field,0) as field from table
或者
双击你的adoquery,or adotable ,table
添加所有的字段进来,选中你要设置的字段, 再
找到他的gettext事件
procedure TdmBasicMDForm.RecordStateGetText(Sender: TField;
var Text: String; DisplayText: Boolean);
begin
if sender.isnull Then
text:=0
end;