Solved

Add fields to tables

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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…
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…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Edureka is one of the fastest growing and most effective online learning sites.  We are here to help you succeed.

911 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

15 Experts available now in Live!

Get 1:1 Help Now