ComponentOne True DataControl 8.0
DataSourceType Property

Returns the original data type of a data field in the underlying database.

Syntax

Field.DataSourceType= long

Remarks

Read/Write at run time. Not available at design time. Property applies to Field object.

This property is intended for advanced users, it rarely needs to be set to anything other than the default.

It indicates the ADO/OLE DB data type of the field as it is exposed to the clients, the bound controls. Its value is one of the types listed in the ADO DataTypeEnum. ADO/OLE DB types include variant data types allowed for TData control fields (see Type property), and contain some additional types. For example, ADO has several types corresponding to the date type (tdbTypeDate): adDate, adDBDate, adDBTime and adDBTimeStamp. They are all date/time types, but have some subtle differences.

By default, for data fields in data source mode (DataMode = 0 – DataSource), this property is set to the ADO/OLE DB type of the corresponding data source field. This type can be different from Type, as the example with date types shows. For all four types in the example the Type is set to tdbTypeDate.

For all other kinds of TData control fields, the default value of DataSourceType is the Type property value.

Bound controls see the field’s DataSourceType as the true type of the field. The ADO type of a field in TData.Recordset.Fields is also determined by the DataSourceType property. You can set the DataSourceType property to a certain ADO/OLE DB type and thus make the field appear to the clients as having the specified type, in case you need a specific type not supported by the Type property.

See ADO documentation for details on the ADO/OLE DB data types, ADO Field.Type property and DataTypeEnum constants.

 

 


Copyright (c) GrapeCity, inc. All rights reserved.

Product Support Forum  |  Documentation Feedback