BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Persistent fields at runtime?

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (Multi-Tier)
View previous topic :: View next topic  
Author Message
Andreas Krügersen
Guest





PostPosted: Thu Apr 08, 2004 3:35 pm    Post subject: Persistent fields at runtime? Reply with quote



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





PostPosted: Thu Apr 08, 2004 4:18 pm    Post subject: Re: Persistent fields at runtime? Reply with quote



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





PostPosted: Thu Apr 08, 2004 5:15 pm    Post subject: Re: Persistent fields at runtime? Reply with quote



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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (Multi-Tier) All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.