PRB: E_NOINTERFACE Returned from CRowset Move Methods (190904)
The information in this article applies to:
- Microsoft OLE DB, when used with:
- Microsoft Visual C++, 32-bit Enterprise Edition 6.0
- Microsoft Visual C++, 32-bit Professional Edition 6.0
- Microsoft Visual C++, 32-bit Learning Edition 6.0
This article was previously published under Q190904 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_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
...
}
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.
Modification Type: | Minor | Last Reviewed: | 3/2/2005 |
---|
Keywords: | kbConsumer kbDTL kbprb kbProvider kbtemplate KB190904 kbAudDeveloper |
---|
|