I have a datamodule with several TClientDataSets with fields and field definitions, no provider.
My recent design time changes to all of these:
- Set active=false
- Add field and fielddef for integer field
TT_APIVERSION - Right-click 'Create dataset'
If there are one or more fields with FieldKind = fkInternalCalc, I get a 'Name not unique in this context' error.
Changing them to fkCalculated 'solves' the issue (but I had to check my OnCalcField handlers to make sure they also worked for State = dsCalcFields)
This is code that has gone through several Delphi versions, current is Alexandria 28.0.44500.8973
We have done modifications like this before, the datasets had Active=true when I started, and the form contained PersistDataPacket.Data blobs.
Is this a (new) Delphi bug or is there something about fkInternalCalc fields that I'm missing?
Remove all fields defined as
fkInternalCalcfrom theFieldDefscollection before any call toCreateDataset(so also right-clicking 'Create dataset').I'm not sure if it's a bug or a feature, but
CreateDatasettries to addfkInternalCalcfields toFieldDefscollection without checking whether it previously existed.If you have all the
FieldDefsand correspondingFieldscreated, you can as well delete all items fromFieldDefscollection, field definitions will be recreated.