Subject Re: [IBO] Fill titles in a query in execute time
Author Frank Ingermann
Hi,

pepmallorca wrote:
>
> Hello:
>
> In some cases, I have an IB_Query_Tmp that I use to create a query,
> and then show in a IB_GRID:
>
> I write lines like:
>
> sql.clear;
> sql.add('select a,b,c from table where c=:pC');
> prepare;
> parambyname('pC').AsString:='xxxx';
> first;
>
> But, how can I link a title, to each of the columns (a,b,c), in
> execution time, before show the information in the grid?
>
> Something like...
>
> FieldByName('a').Title:='First name';
> FieldByName('b').Title:='Adress';
>
> And information about alignment?

take a look at the fieldsxxx properties:

with ib_query1 do
begin
sql.add('select emp_no from employee');
FieldsGridLabel.Add('emp_no=Employee Number');
FieldsAlignment.Add('emp_no=left');
prepare;
open;
end;

the basic setup is similar for all: TStrings with
"[tablename.]fieldname=<setting>" on each line. more in the hlp file...

hth,
fingerman

visit 'fingerbirdy' - fingerman's door to Firebird
http://www.fingerbird.de