Subject | Re: [IBO] Master/detail with different field name |
---|---|
Author | hans@hoogstraat.ca |
Post date | 2002-06-28T18:36:14Z |
Hi Helen,
I have master/detail relationships working in my tests
using non matching fieldnames in TIBOQuery. All I had
to do is
Select * from Detail where DetailFieldName = :MasterFieldName
and 'MasterFieldName' MUST be identical to one of the master
fields.
Detail DataSource set to Master TDataSource
ParamCheck must be True.
Best Regards
Hans
=========================================================
Helen Borrie (TeamIBO) wrote:
I have master/detail relationships working in my tests
using non matching fieldnames in TIBOQuery. All I had
to do is
Select * from Detail where DetailFieldName = :MasterFieldName
and 'MasterFieldName' MUST be identical to one of the master
fields.
Detail DataSource set to Master TDataSource
ParamCheck must be True.
Best Regards
Hans
=========================================================
Helen Borrie (TeamIBO) wrote:
>
> At 11:14 AM 28-06-02 +0000, you wrote:
> >Hi,
> >
> >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?
>
> Your problem is that the master-detail relationship with TDataset
> 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
>
>
> ___________________________________________________________________________
> IB Objects - direct, complete, custom connectivity to Firebird or InterBase
> without the need for BDE, ODBC or any other layer.
> ___________________________________________________________________________
> http://www.ibobjects.com - your IBO community resource for Tech Info papers,
> keyword-searchable FAQ, community code contributions and more !
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/