Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我试图通过 C++ 中的 ADO 从 SQL Server 检索数据,如何检查记录集字段的 Null 值?没有 IsNUll() 函数?
在 C++ ADO 记录集中测试 DBNull 涉及检查fieldpointer->Value类型为VARIANT. 要测试空变量值,请检查该vt字段,对于空值,该字段是VT_NULL.
fieldpointer->Value
VARIANT
vt
VT_NULL
所以要测试 DBNull,检查fieldpointer->Value.vt == VT_NULL
fieldpointer->Value.vt == VT_NULL