How to build Master-Detail between TDAMemTable and TClientDataSet

Hi,
I tried to build the Master-detail between TDAMemTable and TClientDatast in runtime. But it doesn’t work. How can I do?

Hi,

You should be able to build m/d relation between TDAMemDataTable.Dataset and TClientDataset.

Hi,
I tried before. But it was failure. TClientDataset hasn’t “DetailField”. I found the other way is using “IndexFieldNames” to build Master-Detail. I want to know any method to clone TClientDataset to TDAMemTable?

Hi,

You can use these workarounds:

  • “convert” TClientDataset to IDADataset with TDatasetWrapper
  • save IDADataset to Bin2 stream and load it to TDAMemDataTable
    or
  • copy each record with TDAMemDataTable.CloneSelectedRecord

also you can try to use legacy TDACDSDataTable and load your data to it and use TDAMemDataTable.CopyRecordSet, but it may not work correctly with modern versions of Delphi - TDACDSDataTable isn’t updated for ages