Solved

Add fields to tables

Posted on 1998-10-15
1
138 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

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…
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…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

830 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