Solved

Add fields to tables

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
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…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

739 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