Procedure TQueryBookForm.ProduceData();
var
DQuery:TQuery;
begin
PaidQuery.First;
BatchMove1.Execute;
PaidQuery.First;
BatchMove1.Source:=SubQuery;//源数据源
BatchMove1.Destination:=ReportsubTable;//目标数据源
if not PaidQuery.Eof then
BatchMove1.Execute;
BatchMove1.Mode:=batAppend;//拷贝模式
PaidQuery.next;
while not PaidQuery.Eof do
begin
BatchMove1.Execute;//调用执行方法
PaidQuery.Next;
end;
/////////////////////////////////
BatchMove1.Source:=PaidQuery;
BatchMove1.Destination:=ReportPaidTable;
BatchMove1.Mode:=batCopy;//更改拷贝模式,由插入改为拷贝
with TQuery do
begin
close;
unprepare;
free;
end;
end;