Re: accessing database fields
From: Brian Bushay TeamB (BBushay_at_Nmpls.com)
Date: 12/23/03
- Previous message: Brian Bushay TeamB: "Re: Latest MDAC version and BetterAdo?"
- In reply to: Terry: "accessing database fields"
- Next in thread: Tony J Hopkinson: "Re: accessing database fields"
- Reply: Tony J Hopkinson: "Re: accessing database fields"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 22 Dec 2003 20:26:16 -0600
>Is there an advantage for one or the other.
>A data field can be access with by using the FieldByName('fieldname')
>parameter or actually creating an instance of the field using the fields
>editor and referencing it using the adodatasetnamefieldname object. Is one
>way better than the other?
There is a performance advantage in having persistent tfields defined so that
Delphi doesn't have to do it at runtime. Using the field object has a very
slight performance advantage over user FieldbyName but I use Fieldbyname because
it makes code much more readable
>
>In addition, if for example, I want to use the display format and the edit
>mask of a database field, I do create and instance of the field, so that I
>can set those properties. In the case where I do this, would it be better
>just to define the data field in question, or define all the fields for that
>particular table?
When you define persistent tfields delphi can only use the fields you have
defined so you need to define all fields you intent to use.
-- Brian Bushay (TeamB) Bbushay@NMPLS.com
- Previous message: Brian Bushay TeamB: "Re: Latest MDAC version and BetterAdo?"
- In reply to: Terry: "accessing database fields"
- Next in thread: Tony J Hopkinson: "Re: accessing database fields"
- Reply: Tony J Hopkinson: "Re: accessing database fields"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]