Solved

Alter structure of TCientDataSet

Posted on 2008-06-20
2
337 Views
Last Modified: 2010-04-05
Hi there,

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

I tried doing this

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

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

How can I add another column to the dataset without losing all the current info?
0
Comment
Question by:wildzero
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 37

Accepted Solution

by:
Geert Gruwez earned 500 total points
ID: 21836570
fDB.Close
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
0
 
LVL 10

Author Comment

by:wildzero
ID: 21840100
Yea that is what I have had to do.
Create a new TClientDataSet and move the data over.

:-/
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

724 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question