How to check for DBNull fields in C ++ - ADO?

I tried to retrieve data from SQL Server via ADO in C ++ and how can I check the null values โ€‹โ€‹of the record fields? thre is not a function of IsNUll ()?

+4
source share
1 answer

Testing for DBNull in a C ++ ADO record set includes checking a fieldpointer->Value property of type VARIANT . To check the values โ€‹โ€‹of the null variant, you check the vt field, which is equal to VT_NULL for null values.

So, to check DBNull, check fieldpointer->Value.vt == VT_NULL

+5
source

All Articles