I'm having trouble with fkInternalCalc
fields when migrating from TClientDataSet
to TFDMemtable
.
We use these fields to manipulate in-memory data, but they will not be persisted, this is very useful.
We have a datasnap
application and we have created a generic method to recover a TFDJSONDataSets
from the server.
procedure TProxyExec.Open(const DataSet: TFDMemTable; Query: String;
const TipoSever: TipoServerDB);
var
Dados: TFDJSONDataSets;
begin
try
GetDataSet(Query,Dados,TipoSever);
DataSet.Close;
DataSet.AppendData(TFDJSONDataSetsReader.GetListValue(Dados,0));
finally
FreeAndNil(Dados);
end;
end;
Everything happens as expected when the DataSet
passed as a parameter does not have in its Fields
, one that is set to fkInternalCalc
.
But when this happens, that is, when there is a field fkInternalCalc
previously created in FDMemtable
, when executing the line
DataSet.AppendData(TFDJSONDataSetsReader.GetListValue(Dados,0));
Debugger Exception Notification Programa.exe raised exception class FDException with message [FireDAC] [DatS]-38. Cannot change table [fdmTabela] structure, when table has rows'.
I debugged using .dcus
, I did not reach consensus. Has anyone gone through this?
We're using XE7 - Update1 Thanks!