Using Type Indicators When Getting and Setting Data

When consumers allocate memory in which to get or set data, they generally use the type corresponding to the indicator returned by IColumnsInfo::GetColumnInfo for the column. When a consumer gets or sets data  according to the type returned, the provider guarantees it can always transfer the data safely. The consumer specifies this indicator in the wType element of the DBBINDING structure used to bind the memory.

The consumer can allocate and bind memory of a different type only if the provider supports a conversion from that type to the type returned by GetColumnInfo. Such conversions are not guaranteed to be safe. For more information, see "Data Type Conversion" in this chapter.