delphi 在做生成表时出错:运行时报错是:CommandText does not return a result set. 请高手帮忙看看!
procedureTsztj.SpeedButton1Click(Sender:TObject);beginwithdm.srglADOQdobeginclose;sql...
procedure Tsztj.SpeedButton1Click(Sender: TObject);
begin
with dm.srglADOQ do
begin
close;
sql.Clear;
sql.Add('select 收入日期,收入类型,收入金额 from srgl where 收入日期 between :d1 and :d2');
parameters.ParamByName('d1').Value:=datetimepicker1.Date;
parameters.ParamByName('d2').value:=datetimepicker2.Date;
open;
end;
with dm.zcglADOQ do
begin
close;
sql.clear;
SQL.Add('select 支出日期,支出类型,支出金额 from zcgl where 支出日期 between :d1 and :d2');
parameters.ParamByName('d1').Value:=datetimepicker1.Date;
parameters.ParamByName('d2').value:=datetimepicker2.Date;
open;
end;
try
with dm.sztjADOQ do
begin
close;
sql.Clear;
sql.Add('insert into szb values(:a,:b,:c,:d,:e,:f)');
parameters.ParamByName('a').Value:=dm.srglADOQ.fieldbyname('收入日期').Value;
parameters.ParamByName('b').Value:=dm.srglADOQ.fieldbyname('收入类型').Value;
parameters.ParamByName('c').Value:=dm.srglADOQ.fieldbyname('收入金额').Value;
parameters.ParamByName('d').Value:=dm.zcglADOQ.fieldbyname('支出日期').Value;
parameters.ParamByName('e').Value:=dm.zcglADOQ.fieldbyname('支出类型').Value;
parameters.ParamByName('f').Value:=dm.zcglADOQ.fieldbyname('支出金额').Value;
open;
end;
finally
end;
end;
先谢谢各位高手。 展开
begin
with dm.srglADOQ do
begin
close;
sql.Clear;
sql.Add('select 收入日期,收入类型,收入金额 from srgl where 收入日期 between :d1 and :d2');
parameters.ParamByName('d1').Value:=datetimepicker1.Date;
parameters.ParamByName('d2').value:=datetimepicker2.Date;
open;
end;
with dm.zcglADOQ do
begin
close;
sql.clear;
SQL.Add('select 支出日期,支出类型,支出金额 from zcgl where 支出日期 between :d1 and :d2');
parameters.ParamByName('d1').Value:=datetimepicker1.Date;
parameters.ParamByName('d2').value:=datetimepicker2.Date;
open;
end;
try
with dm.sztjADOQ do
begin
close;
sql.Clear;
sql.Add('insert into szb values(:a,:b,:c,:d,:e,:f)');
parameters.ParamByName('a').Value:=dm.srglADOQ.fieldbyname('收入日期').Value;
parameters.ParamByName('b').Value:=dm.srglADOQ.fieldbyname('收入类型').Value;
parameters.ParamByName('c').Value:=dm.srglADOQ.fieldbyname('收入金额').Value;
parameters.ParamByName('d').Value:=dm.zcglADOQ.fieldbyname('支出日期').Value;
parameters.ParamByName('e').Value:=dm.zcglADOQ.fieldbyname('支出类型').Value;
parameters.ParamByName('f').Value:=dm.zcglADOQ.fieldbyname('支出金额').Value;
open;
end;
finally
end;
end;
先谢谢各位高手。 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询