Subject | Re: [IBO] TIB_Column.GetAsVariant inconsistent return value if Null |
---|---|
Author | Jason Wharton |
Post date | 2002-03-14T01:32:06Z |
I'm going to try and release it doing exactly what it should here and we
will have to see where problems pop up.
The next sub-release will be TEST.
Jason Wharton
CPS - Mesa AZ
http://www.ibobjects.com
will have to see where problems pop up.
The next sub-release will be TEST.
Jason Wharton
CPS - Mesa AZ
http://www.ibobjects.com
----- Original Message -----
From: "mmenaz" <mmenaz@...>
To: <IBObjects@yahoogroups.com>
Sent: Saturday, March 09, 2002 10:35 AM
Subject: [IBO] TIB_Column.GetAsVariant inconsistent return value if Null
> Patching FastReport IBO part, I've discovered something seems a bad
behaviour of IBO, since the code behaves differently from the
> couterpart VCL (and also differs from logic!)
>
> If I've a field that is NULL (SQL null, I mean), reading it AsVariant
returns a Unassigned variant instead of a varNull.
> Unassigned means that the variant WAS NOT ASSIGNED, while varNull means
that contains the ASSIGNED null value.
>
> Here the code:
> IBAColumn.IMP
> function TIB_Column.GetAsVariant: Variant;
> begin
> Result := Unassigned;
> if not IsNull then
> case SQLType of
> ...
> end;
>
> should become
> begin
> Result := Unassigned;
> if not IsNull then
> begin
> case SQLType of
> ...
> end;
> end
> else
> Result := varNull;
>
> I've tried tha patch, but there are a lot of problems, since I think that
IBO in many places relies upon this strange return value (i.e. maste detail
relation stops working, if I recall correctly).
> So only Jason can make this work properly...
> Thanks
> Marco Menardi