Hello everybody !

I need some help for the TFDBatchMove component.

I have created a method that must copy a source table to a table that does not exist yet in my database (this table would be a kind of clone).

I am testing what FireDAC can offer.

According to Embarcadero the TFDBatchMove component can create a table during the copying process by using the options property.

In the sample code I have added below, there is some comment about what I did with BDE components in order to compare both technologies. You will see that BDE let me do what I expect to do with FireDAC.

I am sure that I am making a mistake but I don't know where exactly.

Here the source code:

PHP Code:
 // I give my source table name and clone table name
procedure TDBConnection.CopyTableToCloneTable(ASourceTableNameACloneTableNamestring);
var
  
FFDCloneTable TFDTable;
begin
 
  
try
 
      
FFDBatchMove.Options := [poClearDestNoUndopoIdentityInsertpoCreateDest]; // I ask to create the destination table
      
FFDCloneTable := TFDTable.Create(nil);
      try
 
        
FFDTable.Active := False;
        
FFDTable.ConnectionName := FFDConnection.ConnectionName;
        
FFDTable.TableName := ASourceTableName;
        
FFDTable.Active := True;
 
        
FFDCloneTable.Active := False;
        
FFDCloneTable.ConnectionName := FFDConnection.ConnectionName;
        
FFDCloneTable.TableName := ACloneTableName;
        
FFDCloneTable.Active := True;
 
 
 
        
FFDBatchMoveDatasetReader.DataSet := FFDTable;
 
        
FFDBatchMoveDatasetWriter.DataSet := FFDCloneTable;
 
 
        
FFDBatchMove.Reader := FFDBatchMoveDatasetReader;
        
FFDBatchMove.Writer := FFDBatchMoveDatasetWriter;
        
FFDBatchMove.GuessFormat;
        
FFDBatchMove.Execute;
 
//******************** BDE Version ***************************
//        FCloneTable.DatabaseName := FDatabase.DatabaseName;
//        FCloneTable.TableName := ACloneTableName;
//
//        FTable.Active := False;
//        FTable.DatabaseName := FDatabase.DatabaseName;
//        FTable.TableName := ASourceTableName;
//        FTable.Active := True;
//
//        FBatchMove.Source := FTable;
//        FBatchMove.Destination := FCloneTable;
//        FBatchMove.Mode := batCopy;
//        FBatchMove.Execute;
 
 
      
finally
        FreeAndNil
(FFDCloneTable);
      
end;
 
  
except
    raise
;
  
end;
 
end
When I run this code, a message says that the destination table doesn't exist . I use MS Access for testing.

If anyone could help me, that would be nice

Thank you very much.