'Invalid variant operation' MemUtils.VarEqual (Line 530)
Posted: Tue 19 Jul 2011 14:23
Delphi 5, ODAC 7.20.0.7
Changes in TCustomDADataSet.SetMasterParams of DBAccess.pas
from Version 7.20.0.6 to 7.20.0.7 results in
'Invalid variant operation' at MemUtils.VarEqual (Line 530)
In our case AParams.IsNull is True, Field.IsNull is not True
so VarEqual is called with Value1 = varEmpty and Value = string
VarType(Value1) = 0, VarType(Value2) = 256.
Value1 and Value2 are only checked against Null [VarType(Value1) = 1] but not if Empty [VarType(Value1) = 0]!
Program runs to Line 530 and checking (Value1 = Value2) raises Exception.
Changes in TCustomDADataSet.SetMasterParams of DBAccess.pas
from Version 7.20.0.6 to 7.20.0.7 results in
'Invalid variant operation' at MemUtils.VarEqual (Line 530)
In our case AParams.IsNull is True, Field.IsNull is not True
so VarEqual is called with Value1 = varEmpty and Value = string
VarType(Value1) = 0, VarType(Value2) = 256.
Value1 and Value2 are only checked against Null [VarType(Value1) = 1] but not if Empty [VarType(Value1) = 0]!
Program runs to Line 530 and checking (Value1 = Value2) raises Exception.