Board index » delphi » Changing the order of the fields of a paradox-table at runtime

Changing the order of the fields of a paradox-table at runtime

Do somebody know how to change the order of the fields of a paradox-table at
runtime?
(Delphi 3)

Thanks

 

Re:Changing the order of the fields of a paradox-table at runtime


Quote
Omega <bekerle.pct...@gmx.at> wrote in message

news:378d9a2f$0$20522@SSP1NO17.highway.telekom.at...

Quote
> Do somebody know how to change the order of the fields of a paradox-table
at
> runtime?
> (Delphi 3)

Not sure what you mean. If you want to change the sequence in which the
fields are displayed in a grid, change the order of the columns in the grid.
If for whatever reason you need the fields in a specific sequence in a
dataset, use a query. Say, if your table has three fields, field1, field2
and field3, and you want them in reverse order, your SQL would be

SELECT FIELD3, FIELD2, FIELD1 FROM TABLE

Hope this helps.

Robert

Quote
> Thanks

Re:Changing the order of the fields of a paradox-table at runtime


Quote
Omega wrote:

> Do somebody know how to change the order of the fields of a paradox-table at
> runtime?
> (Delphi 3)

I don't know any other way but copy the table contents to another
table where the fields are in right order. And then delete the
original one. A bit tedious, but works.

Yet, there must be some other ways because Database Desktop can do
that. It just knows how to command the BDE to do some right Dbi.. tricks
in right order.

Markku Nevalainen

Re:Changing the order of the fields of a paradox-table at runtime


Robert Kaplan schrieb in Nachricht ...

Quote

>Omega <bekerle.pct...@gmx.at> wrote in message
>news:378d9a2f$0$20522@SSP1NO17.highway.telekom.at...
>> Do somebody know how to change the order of the fields of a paradox-table
>at
>> runtime?
>> (Delphi 3)

>Not sure what you mean. If you want to change the sequence in which the
>fields are displayed in a grid, change the order of the columns in the
grid.
>If for whatever reason you need the fields in a specific sequence in a
>dataset, use a query. Say, if your table has three fields, field1, field2
>and field3, and you want them in reverse order, your SQL would be

>SELECT FIELD3, FIELD2, FIELD1 FROM TABLE

>Hope this helps.

>Robert
>> Thanks

I have to physically rearrange the columns in the table's structure.

Re:Changing the order of the fields of a paradox-table at runtime


1. Create a new table with the fields in the desired order.
2a. Use a tBatchMove to move the data from the old table to the new table.
See the Mappings property for specifying how the fields are to be copied.
2b. Write a simple procedure to copy the fields (presuming same # fields of
matching types and names), e.g.

    src.First;
    while not src.EOF do
        begin
        dst.Insert;
        for i := 0 to src.(FieldCount - 1) do
            dst [src.Fields [i].FieldName] := src.Fields [i].Value;
        dst.Post;
        src.Next;
        end;

Quote
Omega <bekerle.pct...@gmx.at> wrote in message

news:378ecdb5$0$18844@SSP1NO17.highway.telekom.at...
Quote

> Robert Kaplan schrieb in Nachricht ...

> >Omega <bekerle.pct...@gmx.at> wrote in message
> >news:378d9a2f$0$20522@SSP1NO17.highway.telekom.at...
> >> Do somebody know how to change the order of the fields of a
paradox-table
> >at
> >> runtime?
> >> (Delphi 3)

> >Not sure what you mean. If you want to change the sequence in which the
> >fields are displayed in a grid, change the order of the columns in the
> grid.
> >If for whatever reason you need the fields in a specific sequence in a
> >dataset, use a query. Say, if your table has three fields, field1, field2
> >and field3, and you want them in reverse order, your SQL would be

> >SELECT FIELD3, FIELD2, FIELD1 FROM TABLE

> >Hope this helps.

> >Robert
> >> Thanks

> I have to physically rearrange the columns in the table's structure.

Re:Changing the order of the fields of a paradox-table at runtime


The BDE call is DBIDoRestructure
ken
Quote
Omega wrote in message <378d9a2f$0$20...@SSP1NO17.highway.telekom.at>...
>Do somebody know how to change the order of the fields of a paradox-table
at
>runtime?
>(Delphi 3)

>Thanks

Other Threads