当前位置导航:炫浪网>>网络学院>>编程开发>>C++教程>>C++ Builder教程

BatchMove的用法

Currency __declspec(dllexport) BMove(TComponent* Owner,TTable *D,TTable *R)
{
   //把一个表追加到另一个表中(用BatchMove)

   file://AisiString mDATE = \"SDATE=\"+Now().DateString();
   TBatchMove *BM=new TBatchMove(Owner);
   Currency CR=0;
   for(R->First();!R->Eof;R->Next()){
      CR += R->FieldByName(\"TPRICE\")->AsCurrency;
      BM->Source=R;
      BM->Destination=D;
      BM->Mappings->Clear();
      BM->Mappings->Add(\"PRICE=TPRICE\");
      BM->Mappings->Add(\"PRUNO=PRUNO\");
      file://BM->Mappings->Add(mDATE);
      BM->Mappings->Add(\"UPRICE=UPRICE\");
      BM->Mappings->Add(\"PCS=PCS\");
      BM->Mode=batAppend;
      BM->Execute();
      }
   delete BM;
   return(CR);
}

相关内容
赞助商链接