 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Andreas Krügersen Guest
|
Posted: Thu Apr 08, 2004 3:35 pm Post subject: Persistent fields at runtime? |
|
|
Hi all,
I am creating my DataSources, DataSets, Providers etc. at runtime.
Thus I am using DataSets with dynamic fields. That's ok so far,
but when I use a master/detail relation I have to add the DataSetField
manually at runtime. That also works but then the ClientDataSet seems
to switch to "persistent-fields" only and all I see in my MasterSet
is the DetailField.
So I guess I have to create all fields persistent at runtime.
Is there any simple way to do it?
And before you ask, it is no option for me to create them at designtime.
thx,
Andreas Krügersen
|
|
| Back to top |
|
 |
Dave Rowntree Guest
|
Posted: Thu Apr 08, 2004 4:18 pm Post subject: Re: Persistent fields at runtime? |
|
|
Andreas Krügersen <kruegersen (AT) projecteam (DOT) de> wrote:
| Quote: | I am creating my DataSources, DataSets, Providers etc. at runtime.
Thus I am using DataSets with dynamic fields. That's ok so far,
but when I use a master/detail relation I have to add the DataSetField
manually at runtime. That also works but then the ClientDataSet seems
to switch to "persistent-fields" only and all I see in my MasterSet
is the DetailField.
|
Indeed. That is the way it works. MIDAS will only create fields if
there are *no* existing (persistent) fields.
| Quote: | So I guess I have to create all fields persistent at runtime.
Is there any simple way to do it?
|
This shows some ways you can create fields at runtime:
http://tinyurl.com/cxsk
--
Dave Rowntree
|
|
| Back to top |
|
 |
Craig Stuntz [TeamB] Guest
|
Posted: Thu Apr 08, 2004 5:15 pm Post subject: Re: Persistent fields at runtime? |
|
|
Andreas Krügersen wrote:
| Quote: | So I guess I have to create all fields persistent at runtime.
Is there any simple way to do it?
|
The very *definition* of a persistent field is that it's added at
design time, so what you're asking for is an oxymoron.
You can, however, create a TDatasetField, configure its properties,
and add it to the dataset in code. This example:
http://www.distribucon.com/download/midas/fieldinfo.zip
...shows how to do it with calculated fields; what you're asking for
is similar.
-Craig
--
Craig Stuntz [TeamB] ˇ Vertex Systems Corp. ˇ Columbus, OH
Delphi/InterBase Weblog : http://delphi.weblogs.com
Please read and follow Borland's rules for the user of their
news server: http://info.borland.com/newsgroups/guide.html
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|