Page 1 of 1

How to differ between null and '' ?

Posted: Sat 13 Sep 2008 13:12
by kaffeburk
I have a varchar field that sometimes is null and sometimes is just empty ('').

How can i check witch one it is? I would like to use a FieldByName to get the field.

Posted: Mon 15 Sep 2008 09:36
by Dimon
To indicate whether the field is null you should use the TField.IsNull property.
To indicate whether the field is empty you should check if TField.AsString = ''.