Microsoft KB Archive/190904

= PRB: E_NOINTERFACE Returned from CRowset Move Methods =

Article ID: 190904

Article Last Modified on 3/2/2005

-

APPLIES TO

 Microsoft OLE DB 2.7, when used with:  Microsoft Visual C++ 6.0 Enterprise Edition

 Microsoft Visual C++ 6.0 Professional Edition

 Microsoft Visual C++ 6.0 Standard Edition 

-

<div class="notice_section">

This article was previously published under Q190904

<div class="symptoms_section">

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.

<div class="cause_section">

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

<div class="resolution_section">

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_pField2) END_ACCESSOR BEGIN_ACCESSOR(1, false) BLOB_ENTRY(3, IID_ISequentialStream, STGM_READ, m_pField3) 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 ...  }

<div class="status_section">

STATUS
This behavior is by design.

<div class="moreinformation_section">

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.

Keywords: kbprovider kbconsumer kbtemplate kbprb kbdtl KB190904

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.