Access 2003
I have a recordset that conatins a number of fields that can be null.
I am trying to test if these fields are null, and so can handle them appropriately.
I have tried
if rs.Fields(0) is nothing then
myString = ""
else
myString = rs.Fields(0)
end if
if rs.Fields(0) is null then
myString = ""
else
myString = rs.Fields(0)
end if
and also
if rs.Fields(0).Length < 1 then
myString = ""
else
myString = rs.Fields(0)
end if
but none of them work. the first 2 just seem to evalutate as false, even when there is no data in that field, and so the code then tries to allocate a null value to my string
the last one always seems to return a length of > 0
So
How do I test specific fields in each row of the recordset to see if they actually contain a value?
K
I have a recordset that conatins a number of fields that can be null.
I am trying to test if these fields are null, and so can handle them appropriately.
I have tried
if rs.Fields(0) is nothing then
myString = ""
else
myString = rs.Fields(0)
end if
if rs.Fields(0) is null then
myString = ""
else
myString = rs.Fields(0)
end if
and also
if rs.Fields(0).Length < 1 then
myString = ""
else
myString = rs.Fields(0)
end if
but none of them work. the first 2 just seem to evalutate as false, even when there is no data in that field, and so the code then tries to allocate a null value to my string
the last one always seems to return a length of > 0
So
How do I test specific fields in each row of the recordset to see if they actually contain a value?
K