What does HRESULT 0xC800041B (hrIndexInUse) mean?

 
Previous Next
hrColumnNotUpdatable hrNullKeyDisallowed

hrIndexInUse

The object and state that matter

hrIndexInUse means an index definition is being used by an open cursor or operation that prevents the requested schema change.

This is the legacy Directory Service backup/restore HRESULT form of JET_errIndexInUse (0xC800041B).

The key comparison is: hrTableInUse blocks the table as a whole; this result isolates one index dependency. The first useful observation is to enumerate cursors on the table and record their current-index names and transactions. This evidence separates index schema, current-index cursor state, key construction, and duplicate data.

Minimum useful trace

  • Code-specific observation: enumerate cursors on the table and record their current-index names and transactions.
  • the raw index key definition, flags, locale, and conditional columns; associate it with this result rather than with a later generic exception.
  • the current index plus every JetMakeKey segment and grbit; associate it with this result rather than with a later generic exception.
  • the encoded key and existing row when uniqueness is involved.

How to avoid a false diagnosis

hrIndexHasPrimarythe table already has a primary index and the request attempts to define another
hrIndexInvalidDefthe index key definition, flags, locale, or conditional metadata is internally invalid
hrIndexHasClusteredthe table already owns a clustered index and cannot accept another clustered layout

The ESE objects in play

Diagnostic layerB-tree index definition, key construction, uniqueness, and current-index cursor state
Typical API surfaceJetCreateIndex, JetDeleteIndex, JetSetCurrentIndex, JetMakeKey, JetSeek, and JetSetIndexRange
Code-specific conditionan index definition is being used by an open cursor or operation that prevents the requested schema change
First corrective directionquiesce users of the index, close or switch cursors, then repeat the schema operation

Index schema and runtime key-building state are separate diagnostic layers. Key bytes depend on segment order, column representation, collation, null rules, and sort direction.

Safe recovery sequence

  1. Freeze the failing request context and record 0xC800041B, the Jet API name, and the current instance/session ownership.
  2. Verify the code-specific precondition: enumerate cursors on the table and record their current-index names and transactions.
  3. Apply the targeted fix: quiesce users of the index, close or switch cursors, then repeat the schema operation.
  4. Before retrying the operation, reconcile index definition, selected cursor index, and key or uniqueness outcome.

Actions that can hide or worsen the problem

  • Do not drop or rebuild an index before checking uniqueness and table-layout dependencies.
  • Do not treat a key-construction or duplicate-key result as database-file corruption.

Technical references


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