请问如何将用BATCHMOVE控件.将DBGRID1里面的所有记录复制到DBGRID2里面去?(请用CODE方式回答我的问题.谢谢!)

解决方案 »

  1.   

    procedure TForm1.Button1Click(Sender: TObject);begin
      if table2.Active = False then
        Exit;
      if SaveDialog1.Execute then
        begin
          Table1.TableName := SaveDialog1.FileName;
          with BatchMove1 do
            begin
              Source := table2;
              Destination := Table1;
              Mode := batCopy;
              Execute;
            end;
         end;
      end;///table1和table2是dbgrid连的datasource的dataset,源表也可以用tquery,
    目标表不行