| Previous | Next |
| DB_E_BADCONVERTFLAG | DB_E_MULTIPLESTORAGE |
DB_E_BADPARAMETERNAME
Meaning
Windows documents DB_E_BADPARAMETERNAME as “Parameter name is unrecognized”. In this case, parameter metadata or binding refers to a name that the current command does not recognize.
Relevant contract
Accessors are created on a specific command or rowset and encode direction, purpose, bound parts and buffer ownership. 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 this result should start with the object that created the accessor, its DBACCESSORFLAGS and every DBBINDING entry.
Diagnostic sequence
- Identify the exact failing stage: parameter metadata or binding refers to a name that the current command does not recognize.
Conditions that specifically lead to it
- Cause 1: the name differs in case or qualification under provider rules.
- Cause 2: command text changed but cached parameter names did not.
- Cause 3: the provider supports only ordinal parameters for the chosen dialect.
Evidence to collect
A useful diagnostic event records provider CLSID and version, process architecture, interface IID and method, object correlation ID, transaction state and the immediately preceding HRESULT. When recording diagnostic 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: the supplied name and stable hash of command text.
- Evidence 2: current parameter ordinals and names reported by the provider.
- Evidence 3: dialect and identifier-comparison rules.
Corrective actions
- Action 1: use provider-reported names where available.
- Action 2: fall back to ordinals when the provider contract is positional.
- Action 3: invalidate parameter-name caches with command changes.
Retry and recovery
Retry rule: retry after mapping the parameter to a recognized current name or ordinal.
Difference from nearby HRESULT values
DB_E_PARAMUNAVAILABLE means metadata could not be derived or supplied, while DB_E_BADPARAMETERNAME rejects a specific name.
Practical scenario
A stored procedure is redeployed with renamed parameters; refreshing metadata prevents the stale name from reaching SetParameterInfo. Keeping it with the method and object state makes this scenario diagnosable instead of reducing it to “database error”.
Official Microsoft references
Looking for a different code? Search another status or error code.