| Previous | Next |
| DB_E_INTEGRITYVIOLATION | DB_E_ABORTLIMITREACHED |
DB_E_BADTYPENAME
Meaning
Windows documents DB_E_BADTYPENAME as “Type name is invalid”. Here, a schema-definition or parameter operation receives a provider type name that is invalid.
Relevant OLE DB contract
This result must be interpreted against this contract: OLE DB schema contracts combine DBIDs, provider type metadata, column attributes, constraints and locale rules; current provider metadata is authoritative; cached ordinals or type assumptions can become invalid after a schema or command change.
Start with the table, column, parameter or schema object named by the failing definition or data operation when investigating this result.
Diagnostic sequence
- Capture this result immediately at the native OLE DB return and obtain the current OLE DB error object before another COM call replaces thread error information.
- Identify the exact stage: a schema-definition or parameter operation receives a provider type name that is invalid.
Specific conditions that produce it
- Cause 1: the type name is misspelled or not recognized.
- Cause 2: a type name from another provider or database dialect is reused.
- Cause 3: length, precision or modifier text is embedded in a field that expects only the native type name.
Evidence to collect before changing the system
- Evidence 1: the exact type-name string and associated DBTYPE.
- Evidence 2: provider literal and type metadata.
- Evidence 3: the table, column or parameter definition using the name.
Corrective actions
- Action 1: select a type name reported by the active provider.
- Action 2: keep provider-specific DDL mappings separate.
- Action 3: pass precision, scale and size through their dedicated structure fields.
Retry and recovery policy
Retry rule: retry after replacing the type name with one valid for the provider.
Difference from related HRESULT values
DB_E_BADTYPE rejects a DBTYPE indicator, while DB_E_BADTYPENAME rejects the provider's textual native type name.
Practical incident
A schema tool emits NVARCHAR2 for a provider that supports NVARCHAR under a different native name; provider-specific mapping resolves it.
Official Microsoft references
Looking for a different code? Search another status or error code.