Conversions Involving DBTYPE_NUMERIC or DBTYPE_DECIMAL

OLE DB Programmer's Reference

When retrieving data from a DBTYPE_NUMERIC or DBTYPE_DECIMAL structure, the provider uses the maximum precision and scale stored in that structure. When storing data in a DBTYPE_NUMERIC or DBTYPE_DECIMAL structure, the provider uses the maximum precision and scale in the metadata for that structure. For consumer structures, these are in the binding structure. For provider structures, these are in the DBCOLUMNINFO structure returned by IColumnsInfo::GetColumnInfo or the DBPARAMINFO structure returned by ICommandWithParameters::GetParameterInfo.

The following table shows the maximum precision and scale used by the provider when accessing data in a DBTYPE_NUMERIC or DBTYPE_DECIMAL structure in the consumer's buffer.


Consumer structure
Getting or
setting data

Maximum precision

Scale
DBTYPE_NUMERIC getting precision element of DBTYPE_NUMERIC structure scale element of DBTYPE_NUMERIC structure
DBTYPE_NUMERIC setting bPrecision element of DBBINDING structure bScale element of DBBINDING structure
DBTYPE_VARNUMERIC getting precision element of DB_VARNUMERIC structure scale element of DB_VARNUMERIC structure
DBTYPE_VARNUMERIC setting bPrecision element of DBBINDING structure bScale element of DBBINDING structure
DBTYPE_DECIMAL getting 29 scale element of DBTYPE_DECIMAL structure
DBTYPE_DECIMAL setting 29 bScale element of DBBINDING structure

The following table shows the maximum precision and scale used by the provider when accessing data in a DBTYPE_NUMERIC or DBTYPE_DECIMAL structure in the provider.


Provider structure
Getting or
setting data

Maximum precision

Scale
DBTYPE_NUMERIC getting precision element of DBTYPE_NUMERIC structure scale element of DBTYPE_NUMERIC structure
DBTYPE_NUMERIC setting bPrecision element of DBCOLUMNINFO or DBPARAMINFO structure bScale element of DBCOLUMNINFO or DBPARAMINFO structure
DBTYPE_VARNUMERIC getting precision element of DB_VARNUMERIC structure scale element of DB_VARNUMERIC structure
DBTYPE_VARNUMERIC setting bPrecision element of DBCOLUMNINFO or DBPARAMINFO structure bScale element of DBCOLUMNINFO or DBPARAMINFO structure
DBTYPE_DECIMAL getting 29 scale element of DBTYPE_DECIMAL structure
DBTYPE_DECIMAL setting 29 bScale element of DBCOLUMNINFO or DBPARAMINFO structure

1998-2001 Microsoft Corporation. All rights reserved.



Microsoft Ole Db 2.0 Programmer's Reference and Data Access SDK
Microsoft OLE DB 2.0 Programmers Reference and Data Access SDK (Microsoft Professional Editions)
ISBN: 0735605904
EAN: 2147483647
Year: 1998
Pages: 1083

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net