The IResultSetStatement Interface


interface IResultSetStatement: IDispatch
  [id(0x0000000C), helpstring("Cancels processing on entire statement.")]
   HRESULT _stdcall Cancel( void );

  [propget, id(0x00000002), helpstring("Number of current result set's columns.")]
   HRESULT _stdcall ColCount([out, retval] long * Value );

  [propget, id(0x00000004), helpstring("Data values of current result set row.")]
   HRESULT _stdcall ResultSet([in] long index, [out, retval] IDataValue ** Value );

  [propget, id(0x00000006), helpstring("Columns of current result set.")]
   HRESULT _stdcall ResultCol([in] long index, [out, retval] IResultColumn ** Value );

  [id(0x00000001), helpstring("Fetches the next row of current result set.")]
   HRESULT _stdcall Fetch([out, retval] VARIANT_BOOL * result );

The object implementing the IResultSetStatement interface provides a way to read, describe and control the result set. It is the ancestor of IStatement and ICatalogStatement.

The one-dimension array describing the result set columns is accessible via the ResultCol property. The first index is zero and its size is determined by the ColCount property. Actually fetched result set row, if any is accessible via the ResultSet property. The first index is also zero. Calling the Fetch function causes the next row of result set to be fetched into a buffer and became accessible via the ResultSet property. It returns true if a row has been fetched, or false if not and there's no other row available. The entire result set can be discarded by calling the Cancel method. It cancels processing of current statement.

Elements composing the one row of result set must be read in ascending order, e.g.


and not