Subject Re: [IBO] Invalid variant operation
Author Michael Vilhelmsen
> Yes, look at all your ParamByName, Params, FieldByName and Fields
> references, where you use the ".Value" method and replace any
problem ones
> 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:


When opening the second I get the above error.

If I instead does this on OnDataChange on the first TIBOQuerys
datasource it works:

IBOQuery2.ParamByName('Navn').AsString := IBOQuery1.FieldByName

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...


> Another source of this problem could be NULLs being treated as
values. IBO
> 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 the
> object's IsNull property before trying to read a Value from it.
> Helen