Duplicate records in TDAMemDataTable when running FillWithDASql

Hi,
I have a procedure for refresh data in TDAMemDataTable that using “FillWithDASql” with condition. If I execute the procedure 2 times, then TDAMemDataTable will show duplicate records. If execute 3 times, TDAMemDataTable will show triple records.

I need to set TDAMemDataTable.Active to false before using “FillWithDASql”. Then it will not duplicate the records. Is it a characteristic for “FillWithDASql” ?

Hi,

this issue appeared after bugs://D19309:

procedure TDABaseDataAdapter.FillWithDASql(aTables: array of TDADataTable;
  aSQLs: array of string; aParameters: array of DataParameterArray);
..
    lRequests[i].IncludeSchema := aTables[i].FieldCount = 0; // <<< changed

update code as

procedure TDABaseDataAdapter.FillWithDASql(aTables: array of TDADataTable;
  aSQLs: array of string; aParameters: array of DataParameterArray);
..
    lRequests[i].IncludeSchema := aTables[i].FieldCount = 0; // <<< changed
    aTables[i].Close; // << should be added too

I’ll add fix to D19309 issue.

Hi,
I tested it works after applying your solution.