Subject | Re: [IBO] Master/detail with different field name |
---|---|
Author | Helen Borrie (TeamIBO) |
Post date | 2002-06-28T12:41:48Z |
At 11:14 AM 28-06-02 +0000, you wrote:
descendants must be formed by matching column names - TDataset doesn't
support the direct linkage otherwise.
If you cannot alter one of the column names to make them identical, you
will need to form the relationship with a parameterised detail set, viz.
select <columns> from detailtable
where ID_Fatt = :id_fatt
Then you should pass the value for :id_fatt in the AfterScroll event of the
master, viz.
with detailquery do
begin
close;
ParamByName('id_fatt').AsInteger := masterquery.FieldByName('ID').AsInteger;
open;
end;
regards,
Helen Borrie (TeamIBO Support)
** Please don't email your support questions privately **
Ask on the list and everyone benefits
Don't forget the IB Objects online FAQ - link from any page at
www.ibobjects.com
>Hi,Your problem is that the master-detail relationship with TDataset
>
>How can I do a master/detail using TIboQuery where the name of the
>field master is different from the name of the field detail
>
>for example:
>
>This is the statement of the query detail
>
>select * from fattbody where ID_Fatt =:Id
>
>the relation is on field ID_Fatt (table detail) and field ID (table
>master)
>
>I've set the datasource of the TIboQuery detail but when I open the
>master and the detail the first time I don't see the records of
>detail until I go to the next record of the master and go back.
>
>What I've forgotten?
descendants must be formed by matching column names - TDataset doesn't
support the direct linkage otherwise.
If you cannot alter one of the column names to make them identical, you
will need to form the relationship with a parameterised detail set, viz.
select <columns> from detailtable
where ID_Fatt = :id_fatt
Then you should pass the value for :id_fatt in the AfterScroll event of the
master, viz.
with detailquery do
begin
close;
ParamByName('id_fatt').AsInteger := masterquery.FieldByName('ID').AsInteger;
open;
end;
regards,
Helen Borrie (TeamIBO Support)
** Please don't email your support questions privately **
Ask on the list and everyone benefits
Don't forget the IB Objects online FAQ - link from any page at
www.ibobjects.com