Subject | TIB_Column.GetAsVariant inconsistent return value if Null |
---|---|
Author | mmenaz |
Post date | 2002-03-09T17:35:40Z |
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
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