请高手指点,我想查询,commitstate为TRUE的记录,我的数据库是ACESS,有一个字段是Boolean类型的,但是我想查询这个字段,如何实现,表txpp(bh,xm,commitstate);
字段commitstate 为是,否,我现在不知道什么实现,请帮我看看我的写的代码如下:var
byter:boolean;procedure TF_SJCX.RadioButton1Cick(Sender: TObject);
begin
if RadioButton1.hecked then
byter:=true
else if RadioButton2.hecked then
byter:=false
end;procedure TF_SJCX.RadioButton2cLick(Sender: TObject);
begin
if RadioButton1.hecked then
byter:=true
else if RadioButton1.hecked then
byter:=false
end;
procedure TF_SJCX.BitBtn2Click(Sender: TObject);
var
ss:string;
time:string;
begin
if CheckBox4.Checked then
ss:=ss+'and commitstate=''true''';
ss:='select * from txjl where 1=1'+ss+' order by fssj desc ';
data1.ADO_SJCX.Close;
data1.ADO_SJCX.SQL.Clear;
data1.ADO_SJCX.SQL.Add(ss);
data1.ADO_SJCX.Open;
if data1.ADO_SJCX.RecordCount= 0 then
begin
showmessage('你没符合查询条件,请重新输入')
end;
end;
字段commitstate 为是,否,我现在不知道什么实现,请帮我看看我的写的代码如下:var
byter:boolean;procedure TF_SJCX.RadioButton1Cick(Sender: TObject);
begin
if RadioButton1.hecked then
byter:=true
else if RadioButton2.hecked then
byter:=false
end;procedure TF_SJCX.RadioButton2cLick(Sender: TObject);
begin
if RadioButton1.hecked then
byter:=true
else if RadioButton1.hecked then
byter:=false
end;
procedure TF_SJCX.BitBtn2Click(Sender: TObject);
var
ss:string;
time:string;
begin
if CheckBox4.Checked then
ss:=ss+'and commitstate=''true''';
ss:='select * from txjl where 1=1'+ss+' order by fssj desc ';
data1.ADO_SJCX.Close;
data1.ADO_SJCX.SQL.Clear;
data1.ADO_SJCX.SQL.Add(ss);
data1.ADO_SJCX.Open;
if data1.ADO_SJCX.RecordCount= 0 then
begin
showmessage('你没符合查询条件,请重新输入')
end;
end;
解决方案 »
- ◆用过东进语音卡进行二次开发的朋友请进◆
- 请问安装程序的底部按钮上方的分割线用Delphi的什么控件实现
- [help]delphi 用ADOQuery 读写上万条数据慢..
- 高分求助!请高手不吝赐教!(记录键盘输入问题)
- 窗体逶明????
- 江湖救急--------VOD服务器编程(多线程 + SOCKET).大侠请进
- 多媒体播放源码求助
- 谁有有关SQL+DELPHI用三层结构技术的实例,最好有源代码的,简单点的无所谓,急用!!!!!!!!!!!!
- 关于Delphi自带例子中一个看不懂的地方
- Delphi与C++ Builder同一款游戏'打飞机'大比拼
- 请大家帮我看看,明天就等着解决问题,交任务,
- [北京]诚聘Delphi程序员(3人)
ss := ss+' and commitstate=true'; //and前面加一个空格 true或false不是字符串,不用加双引号