Subject Re: [IBO] Boolean params in TIBOQuery
Author Lutz Kutscher
Hi,
Thanks for your help. This works fine for fields in the resulting dataset,
but I tried it for parameters, it doesn't work. Setting a parameter to true,
where the corresponding IB/FB data type is SmallInt or Integer causes the
value to be converted to -1.
It seems the problem arises in TParam.SetAsBoolean, where the boolean value
is converted to a variant, which again uses -1 as the TRUE value.
I had hoped, that something in IBO's conversion from TParam to the true
FB-Parameter would offer the possibility to configure "set any parameter
value thas is not 0 to 1".

Well, thanks anyway.



----- Original Message -----
From: "Antti Kurenniemi" <Antti@...>
To: <IBObjects@yahoogroups.com>
Sent: Monday, February 27, 2006 9:06 PM
Subject: Re: [IBO] Boolean params in TIBOQuery


> In the query object's ColumnAttributes, add the following entry for your
> boolean fields:
>
> somebooleanfield=BOOLEAN=1,0
>
> This tells IBO to treat the field "somebooleanfield" as boolean, with 1 as
> true and 0 as false. Add one line per field in the columnattributes. Note
> that this is also available neatly by double-clicking the query object on
> you form.
>
>
> Antti Kurenniemi
>
> ----- Original Message -----
> From: "Lutz Kutscher" <yahoomail@...>
> To: <IBObjects@yahoogroups.com>
> Sent: Monday, February 27, 2006 8:30 PM
> Subject: [IBO] Boolean params in TIBOQuery
>
>
>> I'm a newbie to IBObjects, trying to convert an old BDE-Application to
>> Firebird/IBO.
>> Many of my old queries use a boolean parameter.
>> I've spent the past few hours trying to figure out, why the didn't give
>> the
>> expected results, when I set the parameter to .AsBoolean=True.
>> In my FB-Database I use SmallInt fields for boolean fields with 0 = False
>> and 1 = True.
>> Now I found out, that IBO sets the AsBoolan=True to -1.
>> IBO is so flexible, there must be a fairly easy way to tell it to set
>> boolean=True to +1 instead, I just can't figure out how.
>>
>> Thanks for any help,
>>
>> Lutz
>>
>>
>>
>>
>> ___________________________________________________________________________
>> IB Objects - direct, complete, custom connectivity to Firebird or
>> InterBase
>> without the need for BDE, ODBC or any other layer.
>> ___________________________________________________________________________
>> http://www.ibobjects.com - your IBO community resource for Tech Info
>> papers,
>> keyword-searchable FAQ, community code contributions and more !
>> Yahoo! Groups Links
>>
>>
>>
>>
>>
>>
>>
>
>
>
> ___________________________________________________________________________
> IB Objects - direct, complete, custom connectivity to Firebird or
> InterBase
> without the need for BDE, ODBC or any other layer.
> ___________________________________________________________________________
> http://www.ibobjects.com - your IBO community resource for Tech Info
> papers,
> keyword-searchable FAQ, community code contributions and more !
> Yahoo! Groups Links
>
>
>
>
>
>
>