The Precision property on a Field object indicates the degree of precision for Numeric values for numeric Field objects. This property returns a Byte value indicating the maximum number of digits used to represent numeric values in a Field object.
numericPrecision = currentfield.Precision
The Precision property is used to return the precision of a numeric field object.
The byte value that the Precision property will return is dependent on the data type of the Field object. The value for the ADO data type of the Field object can be one of the following enumerated values for DataTypeEnum:
Enumeration | Value | Description |
---|---|---|
adEmpty | 0 | This data type indicates that no value was specified (DBTYPE_EMPTY). |
adSmallInt | 2 | This data type indicates a two-byte (16-bit) signed integer (DBTYPE_I2). |
adInteger | 3 | This data type indicates a four-byte (32-bit) signed integer (DBTYPE_I4). |
adSingle | 4 | This data type indicates a four-byte (32-bit) single precision IEEE floating point number (DBTYPE_R4). |
adDouble | 5 | This data type indicates an eight-byte (64-bit) double precision IEEE floating point number (DBTYPE_R8). |
adCurrency | 6 | A data type indicates a currency value (DBTYPE_CY). Currency is a fixed-point number with 4 digits to the right of the decimal point. It is stored in an 8-byte signed integer scaled by 10,000. This data type is not supported by the OLE DB Provider. |
adDate | 7 | This data type indicates a date value stored as a Double, the whole part of which is the number of days since December 30, 1899, and the fractional part of which is the fraction of a day. This data type is not supported by the OLE DB Provider. |
adBSTR | 8 | This data type indicate a null-terminated Unicode character string (DBTYPE_BSTR). This data type is not supported by the OLE DB Provider. |
adIDispatch | 9 | This data type indicates a pointer to an IDispatch interface on an OLE object (DBTYPE_IDISPATCH). This data type is not supported by the OLE DB Provider. |
adError | 10 | This data type indicates a 32-bit error code (DBTYPE_ERROR). This data type is not supported by the OLE DB Provider. |
adBoolean | 11 | This data type indicates a Boolean value (DBTYPE_BOOL). This data type is not supported by the OLE DB Provider. |
adVariant | 12 | This data type indicates an automation variant (DBTYPE_VARIANT). This data type is not supported by the OLE DB Provider. |
adIUnknown | 13 | This data type indicates a pointer to an IUnknown interface on an OLE object (DBTYPE_IUNKNOWN). This data type is not supported by the OLE DB Provider. |
adDecimal | 14 | This data type indicates numeric data with a fixed precision and scale (DBTYPE_DECIMAL). |
adTinyInt | 16 | This data type indicates a single -byte (8-bit) signed integer (DBTYPE_I1). This data type is not supported by the OLE DB Provider. |
adUnsignedTinyInt | 17 | This data type indicates a single-byte (8-bit) unsigned integer (DBTYPE_UI1). This data type is not supported by the OLE DB Provider. |
adUnsignedSmallInt | 18 | This data type indicates a two-byte (16-bit) unsigned integer (DBTYPE_UI2). This data type is not supported by the OLE DB Provider. |
adUnsignedInt | 19 | This data type indicates a four-byte (32-bit) unsigned integer (DBTYPE_UI4). This data type is not supported by the OLE DB Provider. |
adBigInt | 20 | This data type indicates an eight-byte (64-bit) signed integer (DBTYPE_I8). This data type is not supported by the OLE DB Provider. |
adUnsignedBigInt | 21 | This data type indicates an eight-byte (64-bit) unsigned integer (DBTYPE_UI8). This data type is not supported by the OLE DB Provider. |
adGUID | 72 | This data type indicates a globally unique identifier or GUID (DBTYPE_GUID). This data type is not supported by the OLE DB Provider. |
adBinary | 128 | This data type indicates fixed-length binary data (DBTYPE_BYTES). |
adChar | 129 | This data type indicates a character string value (DBTYPE_STR). |
adWChar | 130 | This data type indicates a null-terminated Unicode character string (DBTYPE_WSTR). This data type is not supported by the OLE DB Provider. |
adNumeric | 131 | This data type indicates numeric data where the precision and scale are exactly as specified (DBTYPE_NUMERIC). . |
adUserDefined | 132 | This data type indicates user-defined data (DBTYPE_UDT). This data type is not supported by the OLE DB Provider. |
adDBDate | 133 | This data type indicates a OLE DB date structure (DBTYPE_DATE). |
adDBTime | 134 | This data type indicates a OLE DB time structure (DBTYPE_TIME). |
adDBTimeStamp | 135 | This data type indicates a OLE DB timestamp structure (DBTYPE_TIMESTAMP). |
adVarChar | 200 | This data type indicates variable-length character data (DBTYPE_STR). |
adLongVarChar | 201 | This data type indicates a long string value. |
adVarWChar | 202 | This data type indicates a Unicode string value. This data type is not supported by the OLE DB Provider. |
adLongVarWChar | 203 | This data type indicates a long Unicode string value. This data type is not supported by the OLE DB Provider. |
adVarBinary | 204 | This data type indicates variable-length binary data (DBTYPE_BYTES). |
adLongVarBinary | 205 | This data type indicates a long binary value. |
Note that the Precision property returns values that differ from the precision of the host data type for the following ADO data types:
ADO Data Type | Comments |
---|---|
adSmallInt | The precision on the host is 4, but the OLE DB Provider returns a precision of 5. |
adInteger | The precision on the host is 8, but the OLE DB Provider returns a precision of 10. |
adSingle | The precision on the host is 9, but the OLE DB Provider returns a precision of 7. |
adDouble | The precision on the host is 17, but the OLE DB Provider returns a precision of 15. |