Subject | D2010 and 4.9.9 |
---|---|
Author | Alan |
Post date | 2010-02-22T03:35:41Z |
I am doing this on form close (which has never caused me issue before <4.9.9 and D2010):
for i:=0 to IB_Transaction1.DatasetCount-1 do begin
with IB_Transaction1.Datasets[i] do begin
Close;
end;
end;
IB_Transaction1.Commit;
IB_Transaction1.Close;
Action := caFree;
The datasets are not being edited.
Project .... raised exception class EVariantTypeCastError with message 'Could not convert variant of type (UnicodeString) into type (Double)'.
The offending line is IBODataset Line 7553:
else
if ACol.IsNull or ( ACol.Value <> AParam.Value ) then
-----> ACol.Value := AParam.Value;
end;
In this case I have an ACol.Value = 42 and an AParam.Value = ''
Any ideas how to tackle this one? Should I test for empty string here and not assign, or should I try to do something with assigning or unassigning params to the IBODataset before making the call to close?
I can't work out if this is being thrown on an internal dataset or one of my explicit ones. There's a mix of IB_ and IBO queries involved in the total process.
When the dataset is opening, this assignment is fine i.e. when ACol.Value is null and AParam.Value is 42. But I'm not even sure why this assignment gets called during close.
If I change it to this:
if (ACol.IsNull or ( ACol.Value <> AParam.Value )) and (AParam.Value<>'') then
there's no excpetion but I'm not sure what I might be breaking
Alan
for i:=0 to IB_Transaction1.DatasetCount-1 do begin
with IB_Transaction1.Datasets[i] do begin
Close;
end;
end;
IB_Transaction1.Commit;
IB_Transaction1.Close;
Action := caFree;
The datasets are not being edited.
Project .... raised exception class EVariantTypeCastError with message 'Could not convert variant of type (UnicodeString) into type (Double)'.
The offending line is IBODataset Line 7553:
else
if ACol.IsNull or ( ACol.Value <> AParam.Value ) then
-----> ACol.Value := AParam.Value;
end;
In this case I have an ACol.Value = 42 and an AParam.Value = ''
Any ideas how to tackle this one? Should I test for empty string here and not assign, or should I try to do something with assigning or unassigning params to the IBODataset before making the call to close?
I can't work out if this is being thrown on an internal dataset or one of my explicit ones. There's a mix of IB_ and IBO queries involved in the total process.
When the dataset is opening, this assignment is fine i.e. when ACol.Value is null and AParam.Value is 42. But I'm not even sure why this assignment gets called during close.
If I change it to this:
if (ACol.IsNull or ( ACol.Value <> AParam.Value )) and (AParam.Value<>'') then
there's no excpetion but I'm not sure what I might be breaking
Alan