DBSTATUS dbStatus; DBTYPE dbType; CString str; double dValue; long lValue; // pAccessor 是一个指向CDynamicAccessor对象的指针 // nCol是读取的列下标 pAccessor->GetStatus(nCol, &dbStatus); if(dbStatus != DBSTATUS_S_ISNULL && pAccessor->GetColumnType(nCol, &dbType)) { switch (dbType) { case DBTYPE_VARIANT: vt = COleVariant((LPCVARIANT)pAccessor->GetValue(nCol)); break; case DBTYPE_STR: str = (LPCSTR)pAccessor->GetValue(nCol); break; case DBTYPE_WSTR: case DBTYPE_BSTR: str = (LPCWSTR)pAccessor->GetValue(nCol); break; case DBTYPE_I1: case DBTYPE_UI1: lValue = (long)(*((BYTE*)pAccessor->GetValue(nCol))); break; case DBTYPE_I2: case DBTYPE_UI
OLEDB接口读取各数据类型的转换方式(代码节录)
最新推荐文章于 2020-10-30 13:06:40 发布
该段代码展示了如何使用OLEDB接口从不同数据类型(如DBTYPE_VARIANT, DBTYPE_STR, DBTYPE_DATE等)中读取数据,并进行相应的类型转换,包括将数据转换为字符串、日期、浮点数等。"
101755833,8637426,HTML5前端面试题解析:布局、渐进增强与更多,"['HTML', '前端开发', 'CSS', 'JavaScript']
摘要由CSDN通过智能技术生成