Checking for Null Database Values

  • Thread starter Thread starter Vayse
  • Start date Start date
V

Vayse

i want to check if the following field is null.

Dim rsAssets As New ADODB.Recordset

rsAssets.Fields("SubIcon").Value)

IsNull is no longer supported, so what should I use?

Thanks

Vayse
 
Vayse said:
i want to check if the following field is null.

Dim rsAssets As New ADODB.Recordset

rsAssets.Fields("SubIcon").Value)

IsNull is no longer supported, so what should I use?

Thanks

Vayse

Try IsDbNull().
 
Not quite. Convert.DBNull is a constant representing "database null" while Convert.IsDBNull() is the test for it.
 
Al Reid said:
Not quite. Convert.DBNull is a constant representing "database null"
while Convert.IsDBNull() is the test for it.

However, you could use 'If ... Is DBNull.Value Then...' instead of
'IsDBNull'.
 
if rsAssets.Fields("SubIcon") = convert.dbnull then

end if
Al Reid said:
Not quite. Convert.DBNull is a constant representing "database null"
while Convert.IsDBNull() is the test for it.
 
Thanks Herfried,

That was what I meant.

Herfried K. Wagner said:
However, you could use 'If ... Is DBNull.Value Then...' instead of
'IsDBNull'.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top