ClientDataSet and adding fields to an existing XML file.

ClientDataSet and adding fields to an existing XML file.

Post by Michal Bor » Sun, 29 Aug 2004 20:58:26


Hello.

I have this application which saves data to a ClientDataSet (into an
XML) file.

I'm in the need to add fields. There would be no trouble if I was the
sole user of the application, but it's not the case.

The question is, how to add fields and not lose the existing XML file?
If I just add fields, then the CDS refuses to start/open the old file
with "no xxx field" exception.

I have come up with an idea to just open the XML in one ClientDataSet
and copy the data to another (newer) dataset. Is this the only way - or
maybe can I add fields (cds.Fields.Add) and save the file somehow
without losing its data?


Thanks in advance



--
Michael Borsuk