none
IRowset.GetNextRows failed with DB_S_ENDOFROWSET RRS feed

  • Question

  • Hi dear all,

    I'm trying to read some rows from MDSCHEMA_CUBES table , the code is as follow

       

    void coledb::query()
    {
      HRESULT hr;
      IDBSchemaRowset *schema = nullptr;
      hr = m_session->CreateSession(nullptr,__uuidof(IDBSchemaRowset),(IUnknown**)&schema);

      if (SUCCEEDED(hr))
      {
        IRowset *rs = nullptr;      
        auto nams = {L"CATALOG_NAME",L"SCHEMA_NAME",L"CUBE_NAME"};
        unsigned idx = 0;
        VARIANT cols[3] = {0};
        for(int i = 0 ; i<3; i++) VariantInit(&cols[i]);
        for( auto &nam : nams)
        {
          cols[idx].vt = VT_BSTR;
          cols[idx].bstrVal = SysAllocString(nam);
          idx++;
        }
        hr = schema->GetRowset(nullptr,schema::MDSCHEMA_CUBES,3,cols,__uuidof(IRowset),0,nullptr,(IUnknown**)&rs);
        if (SUCCEEDED(hr))
        {
          DBCOUNTITEM count = 0;
          HROW        *row = nullptr;
          hr = rs->GetNextRows(DB_NULL_HCHAPTER,0,1,&count,&row);    
          printf("fetched %lld , %08X\n",count,hr);
          if (rs) rs->Release();
        }
      }

      if(schema) schema->Release();
    }

    after some search , I've found the rs had its DBPROP_ROWSET_ASYNCH property set to 

    DBPROPVAL_ASYNCH_INITIALIZE DBPROPVAL_ASYNCH_SEQUENTIALPOPULATION DBPROPVAL_ASYNCH_BACKGROUNDPOPULATION

    this seem the reason I got DB_S_ENDOFROWSET ,

    so , my question is is it possible to change the IRowset to a synchronous one ? many thanks !!!

    Saturday, November 16, 2019 10:14 AM

Answers

  • Hi yushang4,

    Thanks for your update.

    Before we focus on how to figure out the code script of ole DB, we need to notice its Support mechanism. Most of customers gradually use ODBC driver to access all kinds of data source. Therefore, we are not sure if it is the case that the issue would not be supported again.

    OLE DB Supportability Guidelines

    Best Regards,

    Will


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by yushang4 Friday, November 22, 2019 12:53 AM
    Thursday, November 21, 2019 6:15 AM

All replies

  • Hi yushang4,

    Per the code script, are you using OLE DB Interfaces?  What do you want to achieve? Could you please make a more detailed description about your requirement?

    Best Regards,

    Will


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, November 18, 2019 2:21 AM
  • yes , I'm using ole db. I'm just doing some test of ole db. I've tried to set DBPROP_ROWSET_ASYNCH on IDBProperties , but not work , the code is as follow:

    ...

    props[1].dwPropertyID = DBPROP_ROWSET_ASYNCH;
    props[1].vValue.vt = VT_I4;
    props[1].vValue.lVal = 0;    
    ppset[1].guidPropertySet = DBPROPSET_ROWSET;
    ppset[1].cProperties = 1;
    ppset[1].rgProperties = &props[1];

    hr = prop->SetProperties(2,ppset);

    ...

    Wednesday, November 20, 2019 1:00 AM
  • Hi yushang4,

    Thanks for your update.

    Before we focus on how to figure out the code script of ole DB, we need to notice its Support mechanism. Most of customers gradually use ODBC driver to access all kinds of data source. Therefore, we are not sure if it is the case that the issue would not be supported again.

    OLE DB Supportability Guidelines

    Best Regards,

    Will


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by yushang4 Friday, November 22, 2019 12:53 AM
    Thursday, November 21, 2019 6:15 AM