Board index » delphi » DB null value returned by TDataSet's FieldValues

DB null value returned by TDataSet's FieldValues


2005-05-07 12:35:49 AM
delphi73
When the value of a column is a DB null value, does the Variant set
itself to VType varNull when accessing the column through its
FieldValues ? If not how do I check that a DB null value is in the column ?
 
 

Re:DB null value returned by TDataSet's FieldValues

Something like .... if x.fieldbyname('myfield').isnull then ....
"Edward Diener" <XXXX@XXXXX.COM>writes
Quote
When the value of a column is a DB null value, does the Variant set
itself to VType varNull when accessing the column through its
FieldValues ? If not how do I check that a DB null value is in the column
?
 

Re:DB null value returned by TDataSet's FieldValues

You can use FieldByName('SomeField').IsNull or you can assign the Value
property to a variant and test the variant.
V := Qry.FieldByName('SomeField').Value
where V is of type Variant. Then you can use
if VarIsNull(V) then...
--
Bill Todd (TeamB)