PRB: E_NOINTERFACE Returned from CRowset Move Methods

ID: Q190904


The information in this article applies to:


SYMPTOMS

When calling MoveFirst(), MoveNext(), MovePrev(), or MoveLast() using the OLE DB Consumer classes on a rowset with more than one BLOB column, a value of E_NOINTERFACE is returned. This occurs when the OLE DB Provider for ODBC is used.


CAUSE

The OLEDB Provider for ODBC supports binding to only one storage column (ISequentialStream) per record at one time.


RESOLUTION

Either remove the extra BLOB column entry in the column map and the SELECT statement, or move the column into a separate accessor and access one BLOB field at a time. If the latter option is chosen, you must release the first ISequentialStream before getting the next ISequentialStream.

For example, the following code demonstrates how you might fetch two BLOB columns:

Sample Code


   class CTable1Accessor
   {
     public:
       TCHAR m_field1[51];
       ISequentialStream* m_pField2;
       ISequentialStream* m_pField3;
       BEGIN_ACCESSOR_MAP(CTable1Accessor, 2)
         BEGIN_ACCESSOR(0, true)
           COLUMN_ENTRY(1, m_field1)
           BLOB_ENTRY(2, IID_ISequentialStream, STGM_READ, m_field2)
         END_ACCESSOR()
         BEGIN_ACCESSOR(1, false)
           BLOB_ENTRY(3, IID_ISequentialStream, STGM_READ, m_field3)
         END_ACCESSOR()
       END_ACCESSOR_MAP()
       ...
   };
   void SomeFunc()
   {
      CTable1 t1;
      t1.Open();
      t1.MoveNext();
      // Read the data from t1.m_pField2 ISequentialStream *
      t1.m_pField2->Release(); // release ISequentialStream for first BLOB
      t1.GetData(1); // go get ISequentialStream for second BLOB
      ...
   } 


STATUS

This behavior is by design.


MORE INFORMATION

For more information about this behavior, refer to OLE DB for ODBC Provider section in the DASDK documentation in MSDN and MSDASQLreadme.txt.

Additional query words: kbvc600 kbTemplate kbODBC kbOLEDB kbProvider


Keywords          : kbtemplate kbODBC kbOLEDB kbProvider kbVC600 
Version           : WINNT:6.0
Platform          : winnt 
Issue type        : kbprb 

Last Reviewed: July 21, 1999