Board index » delphi » How can I make a copy of Paradox table during runtime

How can I make a copy of Paradox table during runtime

Help me, please!

Within DELPHI 4 I have been trying to make a copy of
PARADOX table together with all records during runtime. I
choose a table for the copying through OpenDialog, and I
don't know anything about copied table. I have two
problems:

1. I can't count fields in copied table -
next code doesn't work:

Table1.FieldsCount;

It is called the trouble with syntax.

2. If I knew somewhere a count of fields in copied table,
would I be able to use the method FieldDefs.Add for
determination all needed fields within the next code:

for i:=0 to Table1.FieldsCount do
begin
 Add(Table1.Fields[i].FieldName, Table1.Fields
[i].FieldType, Table1.Fields[i].FieldSize, True);
end;

?

Are there other methods to make a copy exist?

* Sent from AltaVista http://www.altavista.com Where you can also find related Web Pages, Images, Audios, Videos, News, and Shopping.  Smart is Beautiful

 

Re:How can I make a copy of Paradox table during runtime


Hi,

There are 2 options :

1.  You can use a TBatchMove component for this. Just look at
     ..\Delphi4\Help\Examples\BatchMv and ..\BatchMv2 for some examples.

2. if you have Delphi 4 Pro or better, than you have the source code
    of the TBatchmove component. So you can look at it how it is done.
    You will find the source code in ..\Delphi4\Source\Vcl\dbtables.pas and
    look for TBatchMove.

Greetings,

Rob Segerink

Quote
Helga wrote in message <0b63106f.8c3e2...@usw-ex0108-062.remarq.com>...
>Help me, please!

>Within DELPHI 4 I have been trying to make a copy of
>PARADOX table together with all records during runtime. I
>choose a table for the copying through OpenDialog, and I
>don't know anything about copied table. I have two
>problems:

>1. I can't count fields in copied table -
>next code doesn't work:

>Table1.FieldsCount;

>It is called the trouble with syntax.

>2. If I knew somewhere a count of fields in copied table,
>would I be able to use the method FieldDefs.Add for
>determination all needed fields within the next code:

>for i:=0 to Table1.FieldsCount do
>begin
> Add(Table1.Fields[i].FieldName, Table1.Fields
>[i].FieldType, Table1.Fields[i].FieldSize, True);
>end;

>?

>Are there other methods to make a copy exist?

>* Sent from AltaVista http://www.altavista.com Where you can also find

related Web Pages, Images, Audios, Videos, News, and Shopping.  Smart is
Beautiful

Re:How can I make a copy of Paradox table during runtime


Quote
Helga wrote:
> Help me, please!

> Within DELPHI 4 I have been trying to make a copy of
> PARADOX table together with all records during runtime. I
> choose a table for the copying through OpenDialog, and I
> don't know anything about copied table. I have two
> problems:

Try the TBatchMove component - this will eliminate the need for you to know about the table structure and write code.

Re:How can I make a copy of Paradox table during runtime


Quote
"Helga" <jenNOjeS...@parks.lv.invalid> wrote in message

news:0b63106f.8c3e26d5@usw-ex0108-062.remarq.com...

Quote
> Help me, please!

> Within DELPHI 4 I have been trying to make a copy of
> PARADOX table together with all records during runtime. I
> choose a table for the copying through OpenDialog, and I
> don't know anything about copied table. I have two
> problems:

If you want to make an exact copy you might consider simply copying the
physical files using Win API calls such as CopyFile of SHFileOperation - you
need to copy <tablename>.*

Other Threads