Board index » delphi » Adding Paradox-Fields with default-value at runtime

Adding Paradox-Fields with default-value at runtime

Hi there!

Now I know that adding Paradox-Fields with default-value at runtime can be
achieved using the Function DbiDoRestructure. At
www.borland.com/devsupport/bde/bdeapiex.
 I found some exemples for applying it this function.

But I do not know yet if I can use the function ChangeField(Table: TTable;
Field: TField; Rec: ChangeRec);
given at example 3 for doing what I want. I couldn't find documentation on
how to use the parameters neither of Rec: ChangeRec nor of  pFields:
pFLDDesc.

Can anybody help me? Thanx in advance!!

Klaus Edelmann

---------------------------------------------------------------
Sander und Schlter Ingenieurbro fr Software und Systeme GmbH
            Gahlenfeldstrasse 51, D-58313 Herdecke
        Tel.: +49 2330 8007-15  *  Fax: +49 2330 8007-29
                Internet: http:\\www.s2gmbh.de
---------------------------------------------------------------

 

Re:Adding Paradox-Fields with default-value at runtime


Quote
"Klaus Edelmann" <edelmann-nientes...@s2gmbh.de> wrote in message

news:9ela4r$m5i$00$1@news.t-online.com...

Quote
> Hi there!

> Now I know that adding Paradox-Fields with default-value at runtime can be
> achieved using the Function DbiDoRestructure. At
> www.borland.com/devsupport/bde/bdeapiex.
>  I found some exemples for applying it this function.

> But I do not know yet if I can use the function ChangeField(Table: TTable;
> Field: TField; Rec: ChangeRec);
> given at example 3 for doing what I want. I couldn't find documentation on
> how to use the parameters neither of Rec: ChangeRec nor of  pFields:
> pFLDDesc.

You can also add fields to a Paradox table using the SQL ALTER TABLE
command.  It is much easier than setting it up with dbiDoRestructure  Once
the fields are added, you can then execute an SQL statement to update all
records and set the desired fields to specific values.

Check out the example Delphi code that does this here:
http://bdesupport.com/faq.htm#addfield

Hope this helps...
--
Vinnie Murdico
The BDE Support Page
http://www.bdesupport.com

Re:Adding Paradox-Fields with default-value at runtime


Quote
>But I do not know yet if I can use the function ChangeField(Table: TTable;
>Field: TField; Rec: ChangeRec);
>given at example 3 for doing what I want.

No you can't

You need to use dbiDoRestructure twice.  First to add the field then to add the
default assuming you want to add the default as a validity check.
http://www.borland.com/devsupport/bde/bdeapiex/dbidorestructure.html
Take a look at examples 1 and 10
--
Brian Bushay (TeamB)
Bbus...@NMPLS.com

Re:Adding Paradox-Fields with default-value at runtime


"Brian Bushay TeamB" <BBus...@Nmpls.com> wrote in message
news:pi0ugtsskmq9t3lujsfrpipr1p172910el@4ax.com...
Quote

> >But I do not know yet if I can use the function

ChangeField(Table: TTable;
Quote
> >Field: TField; Rec: ChangeRec);
> >given at example 3 for doing what I want.
> No you can't

> You need to use dbiDoRestructure twice.  First to add the field
then to add the
> default assuming you want to add the default as a validity
check.

http://www.borland.com/devsupport/bde/bdeapiex/dbidorestructure.h
tml

Quote
> Take a look at examples 1 and 10

Not really. dbiDoRestructure function is very powerful and it
takes only one call to achieve any changes necessary. The only
drawback is the lack of proper documentation of all BDE API
functions.

--
Jovan Sedlan
i...@sedlan.com
http://www.sedlan.com
#7 Components Home

Other Threads