Data types are either fixed-length or variable-length. This refers to whether the provider can predict how much memory is allocated for the data based on its type indicator. If the provider can predict this (fixed-length data types), it ignores the cbMaxLen element of the DBBINDING structure. If the provider cannot predict this (variable-length data types), the consumer must specify how much memory was allocated for the data in cbMaxLen.
When the length part of a binding is applied to a column, the length includes all bytes of the value. It should be the length passed to IMalloc to allocate a buffer big enough to hold the data value. If the value is converted, the length should be the length in bytes that the value has after conversion, in the type specified by the consumer.
If a value is truncated when it is copied into the consumer's structure, then it fills the buffer up to the limit of the specified width and is truncated abruptly. No attempt is made to trailing-align or trim the value, although strings are null-terminated. The returned length is the length in bytes of the untruncated value, which the consumer can compare to cbMaxLen to determine how many bytes were truncated.
DBTYPE_BYREF, DBTYPE_ARRAY, and DBTYPE_VECTOR are modifiers of data types and do not affect whether a data type is fixed-length or variable-length. However, these do affect how data is stored and the meaning of cbMaxLen in the DBBINDING structure.
For a complete list of fixed-length and variable-length data types, see "Fixed-Length Data Types" and "Variable-Length Data Types" in Appendix A.