| Previous | Next |
| DB_E_BADCONVERTFLAG | DB_E_MULTIPLESTORAGE |
DB_E_BADPARAMETERNAME
Parameter name is unrecognized
Exact value and result class
DB_E_BADPARAMETERNAME has unsigned value 2147749469 (0x80040E5D) and signed 32-bit value -2147217827. AllStat describes it as “Parameter name is unrecognized”. In this result, parameter metadata or binding refers to a name that the current command does not recognize.
The high bit is set, so DB_E_BADPARAMETERNAME is a failure HRESULT. Its facility is 4 (FACILITY_ITF) and its low code is 3677 (0x0E5D). For DB_E_BADPARAMETERNAME, these fields identify an interface-defined result family; they do not identify the provider instance, method, object generation or partial effects.
Contract boundary
For DB_E_BADPARAMETERNAME, accessors are created on a specific command or rowset and encode direction, purpose, bound parts and buffer ownership. For DB_E_BADPARAMETERNAME, a valid HACCESSOR on one object is not interchangeable with a parameter accessor, a readable row accessor or an accessor created for another generation.
Investigation of DB_E_BADPARAMETERNAME should start with the object that created the accessor, its DBACCESSORFLAGS and every DBBINDING entry. Capture DB_E_BADPARAMETERNAME before ADO, ATL, .NET or a database abstraction layer replaces the native HRESULT with a generic exception.
Diagnostic sequence
- Capture raw
0x80040E5Dand symbolicDB_E_BADPARAMETERNAMEat the native call boundary. - Identify the exact failing stage for
DB_E_BADPARAMETERNAME: parameter metadata or binding refers to a name that the current command does not recognize. - Retrieve all OLE DB error records for
DB_E_BADPARAMETERNAMEbefore another COM call replaces thread error information. - Compare the live object state and provider-granted capabilities with the input that produced
DB_E_BADPARAMETERNAME. - Reduce the
DB_E_BADPARAMETERNAMEoperation to the smallest case that preserves the same accessor contract. - Apply one evidence-backed correction for
DB_E_BADPARAMETERNAMEand verify that the result is not merely replaced by a neighboring HRESULT.
Conditions that specifically lead to this result
- Cause 1 for
DB_E_BADPARAMETERNAME: the name differs in case or qualification under provider rules. - Cause 2 for
DB_E_BADPARAMETERNAME: command text changed but cached parameter names did not. - Cause 3 for
DB_E_BADPARAMETERNAME: the provider supports only ordinal parameters for the chosen dialect.
Evidence to collect
A useful DB_E_BADPARAMETERNAME event records provider CLSID and version, process architecture, interface IID and method, object correlation ID, transaction state and the immediately preceding HRESULT. When recording DB_E_BADPARAMETERNAME data involving parameter values, row values and provider-owned storage pointers, use types, lengths, hashes or redacted identifiers rather than secrets or complete business data.
- Evidence 1 for
DB_E_BADPARAMETERNAME: the supplied name and stable hash of command text. - Evidence 2 for
DB_E_BADPARAMETERNAME: current parameter ordinals and names reported by the provider. - Evidence 3 for
DB_E_BADPARAMETERNAME: dialect and identifier-comparison rules.
Corrective actions
- Action 1 for
DB_E_BADPARAMETERNAME: use provider-reported names where available. - Action 2 for
DB_E_BADPARAMETERNAME: fall back to ordinals when the provider contract is positional. - Action 3 for
DB_E_BADPARAMETERNAME: invalidate parameter-name caches with command changes.
Retry and recovery
Retry rule for DB_E_BADPARAMETERNAME: retry after mapping the parameter to a recognized current name or ordinal. A DB_E_BADPARAMETERNAME retry is safe only when the relevant input, object generation, capability or external state has changed. Before replaying a modifying call that returned DB_E_BADPARAMETERNAME, determine whether rows, schema objects or URL resources were partially created or changed.
Do not turn DB_E_BADPARAMETERNAME into an unbounded retry loop. Preserve cancellation for DB_E_BADPARAMETERNAME and use a fresh provider object when the failed call may have left local state ambiguous.
Difference from nearby HRESULT values
DB_E_PARAMUNAVAILABLE means metadata could not be derived or supplied, while DB_E_BADPARAMETERNAME rejects a specific name. Telemetry and remediation for DB_E_BADPARAMETERNAME should keep these outcomes distinct.
Practical scenario
A stored procedure is redeployed with renamed parameters; refreshing metadata prevents the stale name from reaching SetParameterInfo. Keeping DB_E_BADPARAMETERNAME with the method and object state makes this scenario diagnosable instead of reducing it to “database error”.
Developer and operations guidance
Code handling DB_E_BADPARAMETERNAME should release COM objects in ownership order, retain per-row, per-column or per-property statuses, and log granted capabilities rather than only requested options. While handling DB_E_BADPARAMETERNAME, opaque values such as HACCESSOR, HROW, HCHAPTER, DBID components and provider handles must remain scoped to the object that issued them.
Operational dashboards for DB_E_BADPARAMETERNAME should group by provider version, interface, method and normalized failure stage. A DB_E_BADPARAMETERNAME event must not expose passwords, tokens, full connection strings, unrestricted command text or raw row contents.
Official Microsoft references
- Microsoft: IAccessor — official documentation relevant to
DB_E_BADPARAMETERNAME. - Microsoft: ICommandWithParameters — official documentation relevant to
DB_E_BADPARAMETERNAME. - Microsoft: OLE DB interfaces — official documentation relevant to
DB_E_BADPARAMETERNAME.
Looking for a different code? Search another status or error code.