Get field type

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
maciejmt
Posts: 27
Joined: Sun 25 Apr 2010 14:14

Get field type

Post by maciejmt » Sun 22 May 2011 21:21

Hi,

I'd like to get column type in TMyQuery object.

Code: Select all

if MyQuery1.Fields[0].AsVariant = vtInteger then
Does exist other way ?

AndreyZ

Post by AndreyZ » Mon 23 May 2011 10:59

Hello,

You should use the following code:

Code: Select all

if MyQuery1.Fields[0].DataType = ftInteger then

Post Reply