BUG: Cursor Services Are Not Used When Execute( ) Is Called from ICommandTextID: Q223417
|
If an OLE DB consumer calls QueryInterface to acquire IRowsetChange from an IRowset interface, the following HRESULT is returned:
This error means that the rowset or OLE DB provider does not support updatability; that is, the Microsoft Oracle OLE DB Provider. In such cases, the consumer can perform updates using SQL UPDATE statements in ICommandText::Execute() or ICommand::Execute(), or by loading OLE DB cursor services. The OLE DB services can be configured to be loaded by setting DBPROP_INIT_OLEDBSERVICES in the DBPROPSET_DBINIT property as follows:hr = -2147467262, 0x80004002 or E_NOINTERFACE
// Load the OLE DB services.
InitProperties[4].dwPropertyID = DBPROP_INIT_OLEDBSERVICES;
InitProperties[4].vValue.vt = VT_I4;
InitProperties[4].vValue.lVal = DBPROPVAL_OS_ENABLEALL;
However, after loading the services, you still may receive the E_NOINTERFACE error.
The OLE DB cursor services are not loaded if the IRowset interface is obtained from ICommandText::Execute() without querying for the ICommand interface. Therefore, a QueryInterface on the IRowset for IRowsetChange returns an E_NOINTERFACE HRESULT error. If you query first for ICommand and then get ICommandText from the ICommand, the services are loaded.
The OLE DB Services will be loaded if you:
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article.
For additional information, please see the OLE DB Services topics in the Data Access SDK 2.1 documentation.
Additional query words:
Keywords : kbDatabase kbOLEDB200bug kbVC kbGrpVCDB kbGrpMDAC kbDSupport kbMDAC200bug kbMDAC210bug
Version : WINDOWS:2.0,2.1
Platform : WINDOWS
Issue type : kbbug
Last Reviewed: May 26, 1999