• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 375
  • Last Modified:

Alter structure of TCientDataSet

Hi there,

I got a TClientDataSet, and I want to add another column to the table.

I tried doing this

fDB : TClientDataSet;
{ .. }
fDB.FieldDefs.Add('TypeResult', ftMemo, 0, false);

But it blows away all my current data....

How can I add another column to the dataset without losing all the current info?
1 Solution
Geert GOracle dbaCommented:
clears all data

if the data comes from a query you can add it by changing the query with an extra column or a calculated field

if you manually added the data
create a new clientdataset with the extra column and copy the data from the old dataset to the new
wildzeroAuthor Commented:
Yea that is what I have had to do.
Create a new TClientDataSet and move the data over.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Train for your Pen Testing Engineer Certification

Enroll today in this bundle of courses to gain experience in the logistics of pen testing, Linux fundamentals, vulnerability assessments, detecting live systems, and more! This series, valued at $3,000, is free for Premium members, Team Accounts, and Qualified Experts.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now