[Overview][Constants][Types][Classes][Procedures and functions][Index] | Reference for unit 'db' (#fcl)

# TDataSet.DataConvert

Convert data from/to native format

## Declaration

Source position: db.pas line 1585

`public procedure TDataSet.DataConvert(`
`aField: TField;`
`aSource: Pointer;`
`aDest: Pointer;`
`aToNative: Boolean`
`); virtual;`

## Arguments

`aField` |  | Field for which data should be converted.
`aSource` |  | Pointer to memory area with source data
`aDest` |  | Pointer to memory area for target data
`aToNative` |  | True if the conversion should happen to native format.

## Description

DataConvert converts the data from field AField in buffer ASource to native format and puts the result in ADest. If the aToNative parameter equals False, then the data is converted from native format to non-native format. Currently, only date/time/datetime and BCD fields are converted from/to native data. This means the routine handles conversion between TDateTime (the native format) and TDateTimeRec, and between TBCD and currency (the native format) for BCD fields.

DataConvert is used internally by TDataset and descendent classes. There should be no need to use this routine in application code.

## Errors

No checking on the validity of the buffer pointers is performed. If an invalid pointer is passed, an exception may be raised.

## See also

TDataset.GetFieldData |  | Get the data for a field
TDataset.SetFieldData |  | Store the data for a field

Documentation generated on: Feb 26 2014