TBatchMove可以啊 if Query1.Active = False then Exit; if SaveDialog1.Execute then begin Table1.TableName := SaveDialog1.FileName; with BatchMove1 do begin Source := Query1; Destination := Table1; Mode := batCopy; Execute; ShowMessage(IntToStr(MovedCount) + ' records copied'); end; end;
if Query1.Active = False then
Exit;
if SaveDialog1.Execute then
begin
Table1.TableName := SaveDialog1.FileName;
with BatchMove1 do
begin
Source := Query1;
Destination := Table1;
Mode := batCopy;
Execute;
ShowMessage(IntToStr(MovedCount) + ' records copied');
end;
end;
如:
1.先在SERVER端建立一个DTS包,如叫DTS_AtoB
2.编辑a.bat://
CRUNDTS SERVERNAME sa password DTS_AToB
3.在button1,onclick事件加入
Shellexecute(handle,'open','a.bat,'',nil,sw_shownormal);