Reputation: 51
I was trying to retrieve data from SQL Server via ADO in C++ and how can I check the Null Values the recordset fields? thre is no IsNUll() function?
Upvotes: 5
Views: 2392
Reputation: 94729
Testing for DBNull in a C++ ADO record set involves checking the fieldpointer->Value
property, which is of type VARIANT
. To test for null variant values, you check the vt
field, which for null values is VT_NULL
.
So to test for DBNull, check fieldpointer->Value.vt == VT_NULL
Upvotes: 6