Solved

Alter structure of TCientDataSet

Posted on 2008-06-20
2
333 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
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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Suggested Solutions

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

770 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