procedure TForm1.ADOTable1aaGetText(Sender: TField; var Text: String; DisplayText: Boolean); begin if adotable1.FieldByName('aa').AsString='t' then text:='是'; if adotable1.FieldByName('aa').AsString='f' then text:='否' end;
procedure TForm1.ADOTable1aaGetText(Sender: TField; var Text: String; DisplayText: Boolean); begin if adotable1.FieldByName('aa').AsBoolean then text:='是' else text:='否'; end;
在 DBGrid的 OnDrawColumnCell事件中写处理代码
在数据集ADOQuery1中新增一计算字段bl; if adoquery1.fieldbyname('aa').asboolean then adoquery1bl.asstring:='是' else adoquery1bl.asstring:='否';
DisplayText: Boolean);
begin
if adotable1.FieldByName('aa').AsString='t' then text:='是';
if adotable1.FieldByName('aa').AsString='f' then text:='否'
end;
DisplayText: Boolean);
begin
if adotable1.FieldByName('aa').AsBoolean then text:='是'
else text:='否';
end;
if adoquery1.fieldbyname('aa').asboolean then
adoquery1bl.asstring:='是'
else
adoquery1bl.asstring:='否';