What does HRESULT 0x00040ED7 (DB_S_NOTSINGLETON) mean?

 
Previous Next
DB_S_STOPLIMITREACHED DB_S_LOCKUPGRADED

DB_S_NOTSINGLETON

OLE DB returned the first row from a non-singleton result

DB_S_NOTSINGLETON is HRESULT 265943 (0x00040ED7) from Microsoft OLE DB. The documented description is “Row object was requested on a non-singleton result; First row was returned.” The high-order severity bit is clear, so this is a success result, but it carries more information than plain S_OK.

A row object was requested where the result contained more than one row, so the provider returned the first row with a warning.

Evidence to preserve

  • Preserve query and key parameters.
  • Preserve actual match count.
  • Preserve ordering clause.
  • Preserve returned row identity.
  • Preserve unique constraints and isolation level.

Where the result is encountered

  • This result can appear in commands requesting a single row object; record the producing interface and method.
  • This result can appear in lookup queries expected to be unique; record the producing interface and method.
  • It can appear in providers converting rowsets into row objects; record the producing interface and method.

State to verify

The central question is whether the caller verifies uniqueness instead of accepting the arbitrary first row as the only match.

Diagnostic sequence

  • Capture the raw HRESULT 0x00040ED7 immediately after the returning method and record whether the caller used SUCCEEDED, FAILED, equality testing, or exception translation.
  • Verify the method-specific state: the caller verifies uniqueness instead of accepting the arbitrary first row as the only match.

Difference from nearby HRESULT values

S_OK for a singleton confirms the request matched the contract; it reports multiple rows hidden behind a first-row result.

Correct handling, retry, and recovery

Treat the row as provisional, report or resolve the uniqueness violation, and change the query or schema so the intended record is deterministic.

Practical validation scenario

A user lookup expected one account but duplicate email records exist. The provider returns the first with it; the application refuses authentication and starts data cleanup.

Developer and administrator guidance

References


Looking for a different code? Search another status or error code.