At design time I create a TClient DataSet, with fields created via
the 'Field Editor'. Some of these fields are nested using TDataSet as a
field type, for these fields I also create fielddefs for
the 'childdefs'. At this point everything is fine. I right-click and
hit 'CreateDataSet'. Reviewing the CDS reveals that it has now lost ALL
of it's nested datasets.
Just to eliminate anything the IDE may be messing up, I tried the above
in code :
with ClientDataSet1.FieldDefs do begin
Add( 'ID', ftInteger, 0, False );
Add( 'CIC', ftString, 5, False );
Add( 'PARTS', ftDataSet, 0, False );
with Find( 'PARTS' ).ChildDefs do begin
Add( 'PNR', ftString, 15, False );
Add( 'MFR', ftString, 5, False );
end;
end;
ClientDataSet1.CreateDataSet;
with ClientDataSet1 do begin
AddIndex( 'ID', 'ID', [ ] );
IndexName := 'ID';
end;
This has the same effect - what am I doing wrong?
BTW the 'objectview' setting of the CDS is 'True'
Please help.
Sent via Deja.com http://www.deja.com/
Before you buy.