Returns an interface pointer to be used to access an object-valued column. IRow::Open will generally return a rowset, row, or stream object, allowing the provider to create the appropriate object for tabular columns and streams. The returned object inherits the access privileges from the original flags used for binding to the row. IRow::Open also can return an interface pointer to a child rowset when called on a chapter-valued column.
HRESULT Open( IUnknown *pUnkOuter, DBID *pColumnID, REFGUID rguidColumnType, DWORD dwFlags, REFIID riid, Iunknown **ppUnk );
Parameters
Object type | Description |
---|---|
DBGUID_STREAM | Column contains a stream of binary data. Use IStream or ISequentialStream. |
DBGUID_ROW | Column contains a nested collection of columns. Use IRow. |
DBGUID_ROWSET | Column contains a nested rowset. Use IRowset. |
GUID_NULL | Column contains a COM object. Open the object as its native type, and return the interface specified by riid. |
Return Code
Note For more information about DBROWCOL_DEFAULTSTREAM, see "Special Row Column DBIDs" in Chapter 9: Row and Stream Objects.
The provider does not support aggregation.
The object has already been created.
pcolumnID is a chapter-valued column, and rguidColumnType is not DBGUID_ROWSET.
The provider would have to open a new connection to support the operation, and DBPROP_MULTIPLECONNECTIONS is set to VARIANT_FALSE.
Comments
IRow::Open is a synchronous operation.
The DBBINDURLFLAG_* flags used in IBindResource for read and write access to open the row are carried through to the access privileges for columns. For example, a row opened with DBBINDURLFLAG_READ will not allow a column to be updated.
Note For more information about DBBINDURLFLAG_* flags, see the reference entry for IBindResource::Bind.
For columns that are themselves rowsets, it is suggested that the object returned has a well-known list of supported interfaces. IRowset, IRowsetInfo, IRowsetChange (only for write access), IAccessor, and IColumnsInfo are the supported interfaces.
If pColumnID specifies a shortcut data type identifier (DBID) such as DBROWCOL_DEFAULTSTREAM or DBROWCOL_URL and the row object does not contain these columns, the provider returns DB_E_BADCOLUMNID.