Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Determining the Datatype of a field. 1

Status
Not open for further replies.

domnu

Programmer
Apr 20, 2004
1
US
Does anyone know how to determine what the underlying datatype for an ADO field is? I know I can use AsString, etc. to make it fit my needs, but is there any way to tell how it is stored in the database?

 
Use the .DataType property of the field -
Code:
Case MyADOTable.FieldByName('MyField').DataType of
ftString:  //do something
ftInteger: //do something else
...
end;

The DataType property is the same whether you're using ADO or BDE components and other components that descend from TDataSet.

-D
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top