Question

I want check if two fields have the same type at runtime. I have the field name as a string. I want know what is the type of field by its name. I use Delphi xe6 and FireDAC. I don't understand how to use TFDMetaInfoQuery for this scope.

Was it helpful?

Solution

Rather than using a TFDMetaInfoQuery, it is much easier if you simply use the metadata exposed by the TFields of your FireDAC datasets. After opening a dataset use the Fields property or the FieldByName or FindField method to reference the field that you are interested in, and then use the DataType, and other properties of the returned TField to inspect the metadata.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top