bool CRBase::SetDataType(ULONG nCol, DBTYPE nDBType, ULONG nLen=0, BYTE nPrecision=0, BYTE nScale=0, DBMEMOWNER nDBMemOwner=DBMEMOWNER_CLIENTOWNED);
Return Value
true if successful; otherwise false.
Parameters
[in] nCol:
A column ordinal.
[in] nDBType:
A data type indicator.
[in] nLen:
A data indicating the length of the buffer used to hold the data of the column nCol in bytes. It is required when nDBType is one of variable-length data types, but it is ignored when nDBType is one of fixed-length data types or the column is a BLOB.
[in] nPrecision:
The maximum precision to use when nDBType is DBTYPE_NUMERIC or DBTYPE_VARNUMERIC only.
[in] nScale:
The scale to use when nDBType is DBTYPE_NUMERIC, DBTYPE_VARNUMERIC, or DBTYPE_DECIMAL only.
[in] nDBMemOwner:
A value, DBMEMOWNER_CLIENTOWNED or DBMEMOWNER_PROVIDEROWNED, specifying whether the consumer or provider is responsible for freeing this memory.
Remark
Configures the DBBINDING structure of the column nCol and forces a provider to do the data conversion into a new data type nDBType. Additionally, calls this function to control the responsibility of freeing the data memory of the column nCol. It is notified that it will fail if nDBMemOwner is DBMEMOWNER_PROVIDEROWNED for most of providers.
It is pointed out that a caller must have a clear picture of how to free the data memory when nDBType is one of special data types when nDBMemOwner is DBMEMOWNER_CLIENTOWNED. For how to free the data memory, click here.