| Previous | Next |
| DB_E_BADCHAPTER | DB_E_BADBINDINFO |
DB_E_CANTCONVERTVALUE
Meaning
Windows documents DB_E_CANTCONVERTVALUE as “Data or literal value could not be converted to the type of the column in the data source, and the provider was unable to determine which columns could not be converted. Data overflow or sign mismatch was not the cause”. Here, the provider cannot convert a data value or literal to the target column type and cannot identify a narrower overflow or sign-mismatch cause.
Specific conditions that produce the result
- Cause 1: text does not conform to the target type's lexical format.
- Cause 2: the value uses an encoding, locale or date representation the provider cannot parse.
- Cause 3: the provider's conversion path loses required semantic information even though the source and destination types are nominally compatible.
Relevant OLE DB contract
This result must be interpreted against this contract: OLE DB separates conversion capability from conversion of a particular value; IConvertType reports supported type routes, while bindings additionally carry length, precision, scale, status and storage semantics.
Start with the provider object performing the conversion and the exact source and destination type description when investigating this result.
Evidence to collect before changing the system
When it involves unconverted values, binary payloads, locale-specific text and parameter data, record types, lengths, hashes or redacted identifiers instead of secrets or full business data.
- Evidence 1: the source DBTYPE, destination DBTYPE and exact length.
- Evidence 2: the binding ordinal, DBSTATUS and sanitized value representation.
- Evidence 3: locale, code page and provider version used for conversion.
Corrective actions
- Action 1: perform explicit validation and normalization before invoking the provider.
- Action 2: bind with a source type the provider documents as convertible.
- Action 3: retrieve OLE DB error records to identify provider-specific parsing requirements.
Practical incident
A timestamp string uses a regional format not accepted by the provider; binding a typed timestamp structure instead of text eliminates it.
Retry and recovery policy
Retry rule: retry only after changing the value representation, locale or binding type.
Difference from related HRESULT values
DB_E_DATAOVERFLOW identifies a range overflow, while DB_E_CANTCONVERTVALUE covers conversion failure where overflow or sign mismatch is not the stated cause.
Official Microsoft references
Looking for a different code? Search another status or error code.