Compartilhar via


IRowsetIdentity::IsSameRow

Compares two row handles to see whether they refer to the same row instance.

Syntax

HRESULT IsSameRow (
   HROW   hThisRow,
   HROW   hThatRow);

Parameters

  • hThisRow
    [in] The handle of an active row.

  • hThatRow
    [in] The handle of an active row.

Return Code

  • S_FALSE
    The method succeeded, and the row handles do not refer to the same row instance.

  • S_OK
    The method succeeded, and the row handles do refer to the same row instance.

  • E_FAIL
    A provider-specific error occurred.

  • E_UNEXPECTED
    ITransaction::Commit or ITransaction::Abort was called, and the object is in a zombie state.

  • DB_E_BADROWHANDLE
    hRowThis or hRowThat was invalid.

  • DB_E_DELETEDROW
    hRowThis or hRowThat referred to a row for which a deletion had been transmitted to the data store.

  • DB_E_NEWLYINSERTED
    The provider is unable to determine identity for a row for which an insertion had been transmitted to the data store. This condition can occur when DBPROP_STRONGIDENTITY is set to VARIANT_FALSE.

Comments

This method makes no logical change to the state of the object.

The row handles refer to the same row instance if the value set in any column in the row by means of one row handle will be the value returned for that column when gotten through the other row handle.

Rowsets that support this interface must also implement the detection of row identity within their rowset. That is, if they fetch rows at different times, they can detect when the row handles are referring to the same logical row and arrange for both row handles to reflect the same data and state.

The value of the row handles ? their bit patterns as handles ? is not necessarily the same if the underlying row is the same. This depends on the value of the DBPROP_LITERALIDENTITY property.

The outcome of IRowsetIdentity::IsSameRow is not changed when one or both of its parameters correspond to a row with a pending delete.