Add a new Database field to a already-existing Paradox table at RUNTIME 
Author Message
 Add a new Database field to a already-existing Paradox table at RUNTIME
Hi,

Can anybody inform me about how to add a new Database field to a
already-existing paradox table
at runtime.

Note:
Delphi 5.0 Help say that I can't use "AddFieldDef" because it cannot be used
to add fields to an already-existing table.

Any help is highly appreciated.

Regards
Steffen



Wed, 18 Jun 1902 08:00:00 GMT
 Add a new Database field to a already-existing Paradox table at RUNTIME

On Thu, 17 Feb 2000 14:22:28 +0100, "Steffen Kristensen"

Quote:

>Can anybody inform me about how to add a new Database field to a
>already-existing paradox table
>at runtime.

>Note:
>Delphi 5.0 Help say that I can't use "AddFieldDef" because it cannot be used
>to add fields to an already-existing table.

There are a number of ways you might do this. Here are two, in order of
increasing complexity/difficulty of use.

Use the local SQL statement ALTER TABLE, executed from a TQuery.

  ALTER TABLE "Customer.db"
  DROP COLUMN FullName
    ADD COLUMN LastName CHAR(35)
    ADD FirstName CHAR(25)

Local SQL (the SQL implementation the BDE uses for dBASE, Paradox, and
FoxPro tables) is documented in the online help file LOCALSQL.HLP, found in
the main BDE directory. This help file is a language reference of the local
SQL implementation (subset) of SQL-92. The copy of this file that came with
BDE 4.x (and earlier versions) was seriously out of date and contained
little useful information. It has since been rewritten. It has been updated
again concurrent with C++Builder 5. Updated copies will have the topic
"VIEWs" in the index (and lack of this topic indicates a pre-update copy).
I can e-mail you a copy of the updated file if you need and desire it.

Another way is with the BDE API function DbiDoRestructure. BDE API
functions are documented in the BDE online help, BDE32.HLP, found in the
main BDE directory. To make a direct call to a BDE API function from a
Delphi unit, the BDE wrapper unit named "BDE" must be named in the unit's
Uses section.

_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
Steve Koterski              "Health nuts are going to feel stupid someday,
Felton, CA                  lying in hospitals dying of nothing."
                                                              -- Redd Foxx



Wed, 18 Jun 1902 08:00:00 GMT
 Add a new Database field to a already-existing Paradox table at RUNTIME


Quote:
>Hi,

>Can anybody inform me about how to add a new Database field to a
>already-existing paradox table
>at runtime.

>Note:
>Delphi 5.0 Help say that I can't use "AddFieldDef" because it cannot be used
>to add fields to an already-existing table.

>Any help is highly appreciated.

>Regards
>Steffen

I have a program which does this, using dbidorestructure,  you are
welcome to a copy if you email me, pete at elmsoft dot demon dot co dot
uk.

I am trying to find the field type of a Money (Currency) field without
success - strings, dates, time, no problem...  anyone know it?

--
Pete Clark

Replies to pete at elmsoft demon co uk



Wed, 18 Jun 1902 08:00:00 GMT
 Add a new Database field to a already-existing Paradox table at RUNTIME

[...]

Quote:
>I am trying to find the field type of a Money (Currency) field without
>success - strings, dates, time, no problem...  anyone know it?

What "field type" is it you are having trouble determining? The native BDE
field type designation (fldstMONEY)? Or the BDE field type and subtype (7
and 21)? Or the local SQL field type (CURRENCY)?

_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
Steve Koterski              "Nothing is impossible for the man who doesn't
Felton, CA                  have to do it himself."
                                                           -- A. H. Weiler



Wed, 18 Jun 1902 08:00:00 GMT
 Add a new Database field to a already-existing Paradox table at RUNTIME

        Oi...

        Create a blank new table with with the old fields + the new
field...

        batch move all records to the new table

        close both tables

        rename old table to *.bak
        rename new table to the name it should be (*.px)

        ZEE

On Thu, 17 Feb 2000 14:22:28 +0100, "Steffen Kristensen"

[]Hi,
[]
[]Can anybody inform me about how to add a new Database field to
a
[]already-existing paradox table
[]at runtime.
[]
[]Note:
[]Delphi 5.0 Help say that I can't use "AddFieldDef" because it
cannot be used
[]to add fields to an already-existing table.
[]
[]Any help is highly appreciated.
[]
[]Regards
[]Steffen
[]
[]

::::::::::::::::::::::::::::::::ZEE_______JLNCF
::::::::::::::::::::::::::::::::Fafe___Portugal

::::::::::::::::::::::::::::::::
::::::::::::::::::::::::::::::::
::::::::::::::::::::::::::::::::
::::::::::::::::::::::::::::::::www.ibit.pt
::::::::::::::::::::::::::::::::1K dots



Wed, 18 Jun 1902 08:00:00 GMT
 
 [ 5 post ] 

 Relevant Pages 

1. How to modified existing field and add new field in existing table for Access database

2. is it posible to add a new field in a paradox table at runtime

3. add new table unless already exists

4. Adding PRIMARY KEY to already existing table's field

5. Adding a New Field to an existing Database Table

6. Updating/Adding a new record that already exists in the db

7. Adding Fields to Paradox Table at Runtime

8. How to add a default value to a field already existing

9. Delhpi - Adding field in an existing Paradox table

10. adding a new field to existing table

11. Adding new fields into an existing Table

12. Adding a new field to an existing table via ADOX


 
Powered by phpBB® Forum Software