我的表有个字段是int型的,我只在里面保存1或0其中一个值,我想在DBGrid里面显示的时候如果是1就显示是,如果是0就显示否。可不可能实现?
解决方案 »
- 多用户下的CreateFileMapping,OpenFileMapping不能正常调用的问题.
- 难度问题:如何做一个最低层的Form,也就说其它程序可以在那个form上面,还有些其它条件,详见内!
- 碰到这样一个怪问题:不能单步调试了!!!
- 寻找bitmap图标
- 弟兄们,小弟昨天受打击了!!!!!!!!!!
- 求助:这个filter怎么写?
- 请教:BDE连接数据库问题
- 关于QuickReport的几个问题
- 急!急!远程数据入库求救
- 如何分别取得数据库中日期型字段中日期的年份、月份?
- delphi里面怎么调用其他语言写出来的dll库?
- 用delphi开发asp组件。组件写完后,怎样打包成安装程序。
或者在DBGrid1DrawColumnCell中判断是否是1,如果是,就把字体颜色和背景颜色改为一样,这样用户就看不到了
procedure TForm1.ADOQuery1Field1GetText(Sender: TField; var Text: String;
DisplayText: Boolean);
begin
if Text='0' then
DisplayText:='否'
else
DisplayText:='是';
end;procedure TForm1.ADOQuery1Field1SetText(Sender: TField;
const Text: String);
begin
if (Text='是')or(Text='1') then
Sender.AsInteger :=1
else
Sender.AsInteger :=0;end;
select a,b,c,'是'as dd from table where d=1
union
select a,b,c,'否'as dd from table where d<>1
union
select a,b,c,'否'as dd from table where d<>1”
在DBGRID编辑后怎样保存?怎样转回Integer型?
select (case md_int when 1 then '是' when 2 then '否' end) as vt_int,
md_field1,md_field2
from table1
if (Sender->AsBoolean)
Text = "是";
else
Text = "否";
from table1
select decode(field1,1 '是',‘否’) from table