VARIANT vartemp;
VARIANT vartemp1;
VARIANT vartemp2; VariantInit(&vartemp);   
VariantInit(&vartemp1);   
VariantInit(&vartemp2);  vartemp.vt = VT_BSTR;
vartemp2.vt = VT_INT; vartemp2.intVal = 0;
vartemp.bstrVal = L"WSID";
hr = m_rsRecordSet->GetRows(-1, vartemp2, vartemp, &vartemp1);
        m_rsRecordSet中确定有数据,但vartemp1结果确是vartemp1.vt为VT_EMPTY
        谢谢了!

解决方案 »

  1.   

    m_rsRecordSet这个是正确的,用get_Fields方法取出来验证过
      

  2.   

    GetRows没这样用过。
    Syntax
    vararray=objRecordset.GetRows(rows,start,fields) Parameter Description 
    rows Optional. A GetRowsOptionEnum value that specifies the number of records to retrieve. Default is adGetRowsRest.
    Note: If you omit this argument it will retrieve all records in the Recordset
     
    start Optional. What record to start on, a record number or a BookEnum value
     
    fields Optional. If you want to specify only the fields that the GetRows call will return, it is possible to pass a single field name/number or an array of field names/numbers in this argument  Example
      

  3.   

    谢谢lfchen,下面的Example怎么没有了?能告诉网址吗?
      

  4.   

    这个是ADOCE31里的方法,跟ADO中的有些不太一样,不过是类似的方法
      

  5.   

    既然拿到RecordSet了,自己一个个遍历好了...