Solved

Add fields to tables

Posted on 1998-10-15
1
135 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
1 Comment
 
LVL 5

Accepted Solution

by:
ronit051397 earned 100 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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

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…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

747 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now