Board index » delphi » Adding calculated fields at runtime to a table. How to do it?

Adding calculated fields at runtime to a table. How to do it?

I need to add some calculated fields to a table in runtime that depends
on some parameters supplied by the user. I need to do it in runtime
because the user is who will define ultimatelly how many fields will be
added. I tryied with FieldDefs and I could not do it, I searched for
some AddXXX method in TTable and nothing....
How to achieve this?

Please help!

Thanks in advance

 

Re:Adding calculated fields at runtime to a table. How to do it?


I think you have to create the appropriate TField object. Then set its
dataset property.

Quote
Jos Sebastin Battig wrote:

> I need to add some calculated fields to a table in runtime that depends
> on some parameters supplied by the user. I need to do it in runtime
> because the user is who will define ultimatelly how many fields will be
> added. I tryied with FieldDefs and I could not do it, I searched for
> some AddXXX method in TTable and nothing....
> How to achieve this?

> Please help!

> Thanks in advance

--
Ken Bailey
Falmouth Software Works Ltd.

Re:Adding calculated fields at runtime to a table. How to do it?


Look at FieldDef.CreateField. You have to create all the data fields if
you are going to add calc fields.

Cheers

Quote
Jos Sebastin Battig wrote:

> I need to add some calculated fields to a table in runtime that depends
> on some parameters supplied by the user. I need to do it in runtime
> because the user is who will define ultimatelly how many fields will be
> added. I tryied with FieldDefs and I could not do it, I searched for
> some AddXXX method in TTable and nothing....
> How to achieve this?

> Please help!

> Thanks in advance

Other Threads