Tclientdataset Temporary Table

Asked

Viewed 713 times

1

Good night.

My question is the following, I have a temporary table created on TClientDataSet.

However, I need to record the data from the temporary table in an XML file and then read again in TClientDataSet, that is, delete the records and reinsert all of them.

But in my ListView, is appearing duplicated records or empty records, and I’ve checked the XML, and it’s all ok.

Any tips on Temporary tables using TClientDataSet?

  • The XML you created by hand or was saved by CDS ? Post your XML to me to take a look!

  • It was in the same hand, it would not serve much to me created by the CDS, I will post the written answer.

1 answer

1


Then, after much research, I learned that the ApplyUpdates(0); does not work in temporary tables, IE, all I did was define the fields I want in TClientDataSet after this, right click and CreateDataSet, then to conclude, make your changes this way:

Edit:

cds.Edit;
valor := cdscampo.value;
cds.Post;

Add:

cds.Append;
cdscampo.value := valor;
cds.Post;

Delete:

cds.Delete;

To simplify, I used Ixmldocument declared and created in the write function itself.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.