| Previous | Next |
| DB_E_BADDEFERRABILITY | DB_E_BADUPDATEDELETERULE |
DB_E_BADMATCHTYPE
MatchType is invalid or the value is not supported by the provider
Exact value and result class
DB_E_BADMATCHTYPE has unsigned value 2147749504 (0x80040E80) and signed 32-bit value -2147217792. AllStat describes it as “MatchType is invalid or the value is not supported by the provider”. In this result, a foreign-key constraint descriptor specifies an invalid or unsupported match type.
The high bit is set, so DB_E_BADMATCHTYPE is a failure HRESULT. Its facility is 4 (FACILITY_ITF) and its low code is 3712 (0x0E80). For DB_E_BADMATCHTYPE, 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_BADMATCHTYPE, OLE DB DDL interfaces identify indexes, commands and constraints with provider-scoped DBIDs. For DB_E_BADMATCHTYPE, constraint descriptors also carry type, column arrays, match behavior, deferrability and update/delete rules that must agree as one structure.
Investigation of DB_E_BADMATCHTYPE should start with the session performing DDL, target table metadata and the exact DBID or DBCONSTRAINTDESC supplied. Capture DB_E_BADMATCHTYPE before ADO, ATL, .NET or a database abstraction layer replaces the native HRESULT with a generic exception.
Evidence to collect
A useful DB_E_BADMATCHTYPE 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_BADMATCHTYPE data involving catalog names, schema names, object identifiers and deployment definitions, use types, lengths, hashes or redacted identifiers rather than secrets or complete business data.
- Evidence 1 for
DB_E_BADMATCHTYPE: match type and constraint type. - Evidence 2 for
DB_E_BADMATCHTYPE: local and referenced column arrays. - Evidence 3 for
DB_E_BADMATCHTYPE: provider-supported referential capabilities.
Conditions that specifically lead to this result
- Cause 1 for
DB_E_BADMATCHTYPE: the match enumeration is invalid. - Cause 2 for
DB_E_BADMATCHTYPE: the provider supports only a subset of match semantics. - Cause 3 for
DB_E_BADMATCHTYPE: match behavior is supplied for a non-foreign-key constraint.
Diagnostic sequence
- Capture raw
0x80040E80and symbolicDB_E_BADMATCHTYPEat the native call boundary. - Identify the exact failing stage for
DB_E_BADMATCHTYPE: a foreign-key constraint descriptor specifies an invalid or unsupported match type. - Retrieve all OLE DB error records for
DB_E_BADMATCHTYPEbefore another COM call replaces thread error information. - Compare the live object state and provider-granted capabilities with the input that produced
DB_E_BADMATCHTYPE. - Reduce the
DB_E_BADMATCHTYPEoperation to the smallest case that preserves the same ddl contract. - Apply one evidence-backed correction for
DB_E_BADMATCHTYPEand verify that the result is not merely replaced by a neighboring HRESULT.
Retry and recovery
Retry rule for DB_E_BADMATCHTYPE: retry after selecting a valid supported match type. A DB_E_BADMATCHTYPE 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_BADMATCHTYPE, determine whether rows, schema objects or URL resources were partially created or changed.
Do not turn DB_E_BADMATCHTYPE into an unbounded retry loop. Preserve cancellation for DB_E_BADMATCHTYPE and use a fresh provider object when the failed call may have left local state ambiguous.
Corrective actions
- Action 1 for
DB_E_BADMATCHTYPE: use a documented match type for foreign keys. - Action 2 for
DB_E_BADMATCHTYPE: omit match fields for unrelated constraint types. - Action 3 for
DB_E_BADMATCHTYPE: verify null-handling semantics before choosing a fallback.
Practical scenario
A portable schema requests a match mode absent from the target provider; choosing the target-supported semantics prevents DB_E_BADMATCHTYPE. Keeping DB_E_BADMATCHTYPE 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_BADMATCHTYPE 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_BADMATCHTYPE, 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_BADMATCHTYPE should group by provider version, interface, method and normalized failure stage. A DB_E_BADMATCHTYPE event must not expose passwords, tokens, full connection strings, unrestricted command text or raw row contents.
Difference from nearby HRESULT values
DB_E_BADUPDATEDELETERULE concerns referential actions, while DB_E_BADMATCHTYPE concerns how composite foreign-key values match. Telemetry and remediation for DB_E_BADMATCHTYPE should keep these outcomes distinct.
Official Microsoft references
- Microsoft: OLE DB data definition language — official documentation relevant to
DB_E_BADMATCHTYPE. - Microsoft: ITableDefinitionWithConstraints — official documentation relevant to
DB_E_BADMATCHTYPE. - Microsoft: IAlterTable::AlterTable — official documentation relevant to
DB_E_BADMATCHTYPE.
Looking for a different code? Search another status or error code.