Requesting the caption of a column

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Oli21

Requesting the caption of a column

Post by Oli21 » Fri 03 Mar 2006 13:09

Hello,

is it possible to retrieve the caption of a column?
i want to store some data in a stringgrid; the first row (a fixed one) should hold the data eg.:

select a.article, a.id, a.locked from xyz a

----------------------------
| article | id | locked |
---------------------------
| data... | ... | ... |
| | | |

and so on...
is it possible to do that? i didn't find any property/method to get the information on the current query.

Best regards,

Oliver

Challenger
Devart Team
Posts: 925
Joined: Thu 17 Nov 2005 10:53

Post by Challenger » Fri 03 Mar 2006 13:42

Try to use the FieldName or DisplayName property of TField. For example:
Caption := OraQuery.Fields[0].FieldName.

Oli21

Post by Oli21 » Fri 03 Mar 2006 14:27

Hello,

there is no .Fieldname or .DisplayName
I'm using TSmartQuery to retrieve the data.

Code: Select all

tQryExpert->Fields->FieldByNumber(j)->AsString;
gives me only the query-result, not the caption of the column.
i'm using borland c++ 6

Best regards,

Oliver[/code]

Challenger
Devart Team
Posts: 925
Joined: Thu 17 Nov 2005 10:53

Post by Challenger » Mon 06 Mar 2006 14:34

To get field name try to use the following code:

Code: Select all

IBCQuery1->Fields->FieldByNumber(j)->FieldName

Post Reply