Subject | Re: [IBO] Default Values |
---|---|
Author | Lucas Franzen |
Post date | 2003-11-11T11:33:20Z |
Ben,
ben_sollis schrieb:
and every query!
Setting default values is working with TIB_StringLists, using the
NAMES/VALUEs property of TStrings.
So you have to set all default values, regardsless of the field type, as
a normal string. It will be typecasted automatically.
Example:
T_INTEGER=22
T_STRING=not applied
T_BOOL=Y
watch out that you have NO blanks around the '='.
(either TIB_Connection or TIBODatabase, depending on your connection
component)
the server. So the connection can keep a list of FieldNames (DomainNames).
When you open a Query the domain name for each single field is known.
When you do an insert on this query there will happen a lookup on the
DefaultValues property and if there's an entry for the domain (in the
above mentioned TIB_StringList) the value is assigned.
I just have no project really using TIBO stuff, so I can't test it at
the moment.
And converting from the BDE is so many years ago now that I really can't
recall....
Maybe you should build a little testing app to get acquainted with the
properties and methods before applying to your app.
Luc.
ben_sollis schrieb:
> Hi all...If you set it at connection level, you don't have to apply it to each
>
> I have set the default values on the Query object on the server side.
>
> It appears that the values tho on the client side are not being
> populated...
>
> example;
>
> in the Dfeault Values of the IBOQuery.DefaultValues I have
>
> JB_TYPE=''
and every query!
Setting default values is working with TIB_StringLists, using the
NAMES/VALUEs property of TStrings.
So you have to set all default values, regardsless of the field type, as
a normal string. It will be typecasted automatically.
Example:
T_INTEGER=22
T_STRING=not applied
T_BOOL=Y
watch out that you have NO blanks around the '='.
> On the clinet side tho, the field is null.Have you set the FieldEntryTypes.fetDomainNames property to TRUE?
(either TIB_Connection or TIBODatabase, depending on your connection
component)
> Am I mistaken in thinking that the values on the client side shouldIf you set fetDomainNames to true then all domains are retrieved from
> be populated by the default values supplied on the server side?
the server. So the connection can keep a list of FieldNames (DomainNames).
When you open a Query the domain name for each single field is known.
When you do an insert on this query there will happen a lookup on the
DefaultValues property and if there's an entry for the domain (in the
above mentioned TIB_StringList) the value is assigned.
>See above.
> Am I setting the sefault values correctly?
> Currently, I am setting numbers to -1 or 0, and the var/char valuesYou're welcome.
> to an empty string '' as in the axample above.
>
> Thanx for help, I know I whine, but I do appreciate the replies :)
I just have no project really using TIBO stuff, so I can't test it at
the moment.
And converting from the BDE is so many years ago now that I really can't
recall....
Maybe you should build a little testing app to get acquainted with the
properties and methods before applying to your app.
Luc.