| View previous topic :: View next topic |
| Author |
Message |
Patrick Moloney Guest
|
Posted: Tue Mar 13, 2007 9:21 pm Post subject: Boolean still not working? |
|
|
I'm using IB 7.5, Delphi 7 with IBX (hence here I am).
I have a Checkbox on my form and a boolean column in my database.
I'm using a stored procedure and a IB stored proc component.
I'd like to say:
ParamByName('MyParameter').AsBoolean := Mycheckbox.Checked;
This looks like it is passing a -1 when checked and 0 when unchecked.
I get Sql error from IB for bad value or overflow. I think it wants 0
or 1.
Only fails when checked and passing -1.
My application includes other boolean work-arounds from previous
version, but I thought this might work by now. Has this never been
fixed?
--
Patrick Moloney |
|
| Back to top |
|
 |
Patrick Moloney Guest
|
Posted: Wed Mar 14, 2007 2:38 am Post subject: Re: Boolean still not working? |
|
|
Further time invested indicates this is not an IBX problem, but a
Delphi component problem. There are multiple entries in QC describing
various incarnations of the problem. However, IBX and the Delphi
components appear incompatible as far as Boolean is concerned.
The Delphi components (TCheckbox in this case) generate -1 for True and
0 for False. IBX and IB expect +1 and 0, producing the SQL exception.
Some explanations that this is C-code heritage for these components.
I have again resorted to:
If MyCheckbox.Checked Then
mySP.ParambyName('PXX').AsInteger = 1
Else
mySP.ParambyName('Pxx').AsInteger = 0;
(This parameter being Boolean).
--
Patrick Moloney |
|
| Back to top |
|
 |
Moore Guest
|
Posted: Thu Mar 15, 2007 8:13 pm Post subject: Re: Boolean still not working? |
|
|
Doesn´t TDBCheckBox have a ValueChecked ValueUnchecked properties???
Patrick Moloney escribió:
| Quote: | The Delphi components (TCheckbox in this case) generate -1 for True and
0 for False. IBX and IB expect +1 and 0, producing the SQL exception.
Some explanations that this is C-code heritage for these components. |
|
|
| Back to top |
|
 |
Patrick Moloney Guest
|
Posted: Thu Mar 15, 2007 10:36 pm Post subject: Re: Boolean still not working? |
|
|
Moore wrote:
| Quote: | Doesn´t TDBCheckBox have a ValueChecked ValueUnchecked properties???
|
I don't know either. I'm not using the TDB.. components.
--
Patrick Moloney |
|
| Back to top |
|
 |
Moore Guest
|
Posted: Fri Mar 16, 2007 6:10 pm Post subject: Re: Boolean still not working? |
|
|
So use them..
Patrick Moloney escribió:
> I don't know either. I'm not using the TDB.. components. |
|
| Back to top |
|
 |
|