Subject | Re: [IBO] Invalid variant operation |
---|---|
Author | Michael Vilhelmsen |
Post date | 2004-01-19T09:46:40Z |
>problem ones
> Yes, look at all your ParamByName, Params, FieldByName and Fields
> references, where you use the ".Value" method and replace any
> with ".AsWhatever", i.e. explicit casting.See I have just made a little test appl.
In this I have only two TIBOQuerys.
Then first does:
Select * from Farver;
The second does:
Select * from Farver_Detail where Navn = :Navn;
In my program is do this on FormShow:
IBODatabase1.Open;
IBOquery1.Open;
IBOquery2.Open;
When opening the second I get the above error.
If I instead does this on OnDataChange on the first TIBOQuerys
datasource it works:
IBOQuery2.Close;
IBOQuery2.ParamByName('Navn').AsString := IBOQuery1.FieldByName
('Navn').AsString;
IBOQuery2.OPen;
Is this the way I should go, or can I do something to make IBO behave
the same way as standard TQuery comp ?
Everywhere in my originally program I ALWAYS uses AsWhatEver when I
use the ParamBy... and the FieldBy...
Michael
>values. IBO
> Another source of this problem could be NULLs being treated as
> doesn't convert nulls to values unless you explicitly tell it to.This is
> fairly complicated to do with TIBOQuery so it's better to test thecolumn
> object's IsNull property before trying to read a Value from it.
>
> Helen