Subject Re: [IBO] Default Values
Author Lucas Franzen
Ben,


ben_sollis schrieb:

> Hi all...
>
> 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=''

If you set it at connection level, you don't have to apply it to each
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 should
> be populated by the default values supplied on the server side?

If you set fetDomainNames to true then all domains are retrieved from
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.

>
> Am I setting the sefault values correctly?

See above.

> Currently, I am setting numbers to -1 or 0, and the var/char values
> to an empty string '' as in the axample above.
>
> Thanx for help, I know I whine, but I do appreciate the replies :)

You're welcome.

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.