注册 登录
编程论坛 Delphi论坛

[求助]显示数据库所有的数据还是显示DRRQ的数据

dzy 发布于 2006-06-09 09:32, 539 次点击

下面的程序当SWXB1.Checked then 是显示数据库所有的数据还是显示DRRQ的数据

其中XM和DRRQ、SWXB是数据库(DQQK)的字段

begin
hide;
QXKJYXGS.SHOW;

.......

if SWXB1.Checked then
begin

QXKJYXGS.ADOQuery2.SQL.Clear;


QXKJYXGS.ADOQuery2.SQL.Add('select * from DQQK where XM=:XM3 and DRRQ=:DRRQ3');

QXKJYXGS.ADOQuery2.Parameters.ParamByName('XM3').Value:=Trim(YHDR.qry1.FieldByName('XM').value);

QXKJYXGS.ADOQuery2.Parameters.ParamByName('DRRQ3').Value:=DateToStr(mytime);

QXKJYXGS.ADOQuery2.Active:=True;

if QXKJYXGS.ADOQuery2.RecordCount>0 then

begin

QXKJYXGS.ADOQuery2.Edit;

QXKJYXGS.ADOQuery2.FieldByName('SWXB').Value:=TimeToStr(DateTime);

QXKJYXGS.ADOQuery2.Post;

QXKJYXGS.ADOQuery2.SQL.Clear;

QXKJYXGS.ADOQuery2.SQL.Add('select * from DQQK where DRRQ=:DRRQ1');

QXKJYXGS.ADOQuery2.Parameters.ParamByName('DRRQ1').Value:=DateToStr(mytime5);

QXKJYXGS.ADOQuery2.Open;

end;
else

begin

......

......

......

end

end

.......

......


问题解决


[此贴子已经被作者于2006-6-9 17:09:19编辑过]

0 回复
1