代码如下:
try
{
   _variant_t vNULL;
   vNULL.vt=VT_ERROR;
   vNULL.scode=DISP_E_PARAMNOTFOUND;

   m_pCommand->ActiveConnection=m_pConnection;
   m_pCommadn->CommandText="delete STU_INF0_TAB where STUDENT_ID=3";
    
   m_pRecordset=m_pCommand->Execute(&vNull,&vNull,adCmdText);
}
catch(_com_error e)
{
   ......
}红色的代码是干嘛的?_variant_t到底是什么东西,查了一下MSDN还是不怎么理解,是不是他里面封装了很多的数据类型,他本身是一个类,vNull就是类对象了,vNULL.vt 不知道是什么了,没有vt这个成员变量啊?scode也是了这样了。大家指点一下啊

解决方案 »

  1.   

    A _variant_t object encapsulates the VARIANT data type. The class manages resource allocation and deallocation and makes function calls to VariantInit and VariantClear as appropriate.
    VARIANT是COM中的,包含类型和数据。
    vt是类型,scode是数据
    VT_ERROR
     An SCODE was specified. The type of the error is specified in scodee. Generally, operations on error values should raise an exception or propagate the error to the return value, as appropriate.
     
    MSDN上有,自己查吧
      

  2.   

    自己在MSDN上查询_variant_t,我刚学的时候也是不懂这个MSDN上有详细定义
      

  3.   

    这些东西MSDN是最好的帮手
    然后加上自己在实际中应用也就理解了