Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Add fields to tables

Posted on 1998-10-15
1
Medium Priority
?
141 Views
Last Modified: 2010-04-06
Hi all......
I have a some paradox tables with important data in them and i'd like to add some fields to them.
I have written a program that adds the fields with "TTable.CreateTable" but the problem is that the data disappears !!!
Is there a way to avoid this and add the fields without the data lost ???
0
Comment
Question by:dotan
[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
1 Comment
 
LVL 5

Accepted Solution

by:
ronit051397 earned 400 total points
ID: 1342958
Use SQL. This must be done exclusively, meaning the table cannot be active in your application or another application,  while SQL is executing.

Example: To add a new field, called 'TEST' to the ANIMALS table write:

      with Query1 do
      begin
        DatabaseName:='DBDEMOS';
        SQL.Text:='ALTER TABLE "ANIMALS.dbf" ADD TEST SMALLINT';
        ExecSQL;
      end;

for more information on SQL statements see:
C:\Program Files\Borland\Common Files\BDE\Localsql.hlp
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

722 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