Solved

Creating Paradox Tables

Posted on 1999-01-20
3
244 Views
Last Modified: 2010-04-06
I want to write a routine that will create a paradox table (including indexes) based upon the structure of another paradox table.  How can I do this ?
0
Comment
Question by:johnclarke
  • 2
3 Comments
 
LVL 8

Accepted Solution

by:
ZifNab earned 100 total points
ID: 1362495
Hi johnClarke,

What about the TBatchMove component with Copy?

info :

batCopy      Create the destination table based on the structure of the source table. If the destination already exists, the operation will delete it, and replace it with the new copy of the source.

Regards, Zif.

0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 1362496
Hi johnClarke
Oops Zif was faster,


Table1 is source and active
Table2 is destination and inactive
both have the same Database entry

procedure TForm1.Button1Click(Sender: TObject);
begin
  Table1.IndexDefs.Update;
  Table2.FieldDefs.Assign(Table1.FieldDefs);
  Table2.IndexDefs.Assign(Table1.IndexDefs);
  Table2.TableName := Edit1.Text;
  Table2.CreateTable;
end;

meikl
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 1362497
Hi johnclarke,

appendix, i've comment out, what i do
procedure TForm1.Button1Click(Sender: TObject);
begin
  Table1.IndexDefs.Update;  {retrieves all available indexes}
  Table2.FieldDefs.Assign(Table1.FieldDefs); {Copy FieldDefinitions}
  Table2.IndexDefs.Assign(Table1.IndexDefs); {Copy IndexDefinitions}
  Table2.TableName := Edit1.Text;  {Give a Name}
  Table2.CreateTable; {Create, existing table will be overwritten}
end;

meikl
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

758 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

19 Experts available now in Live!

Get 1:1 Help Now