Subject Re: [IBO] Master Detail with IBODataset
Author Lee Jenkins
Helen Borrie wrote:
> At 01:37 PM 20/11/2003 -0500, you wrote:
>
>>Lee Jenkins wrote:
>>
>>
>>>Hi,
>>>
>>>It appears that setting this up is different than standard dataset
>>>behavior because I see no MasterKey field property, etc.
>
>
> No, it is the *same* as TQuery.
>
>
>>>Would someone kindly provide an example of syntax to use to setup MD
>>>relationship on a form?
>>>
>>>I am assuming the KeyLinks property is for this....
>
>
> No, Keylinks is not for this.
>
> With both TQuery and TIBOQuery you do the following:
>
> Set the detail query's DataSource property to the TDatasource of the master
> table.
>
> If the foreign key column(s) of the detail have the same name(s) as the
> primary key column(s) - the keylinks - of the master table, then you are done.
>
> If not, then you have to add a parameterised WHERE clause to the SQL of the
> detail, e.g.
> select <fieldlist> from mydetail where myfkeyfield = :the_master_pri_key
>
> Now it's all done.
>
>
>>>
>>Hmmm. Looks like I cannot do this with an IBOQuery, only the TIBOTable...
>
>
> TIBOTable behaves like TTable, TIBOQuery behaves like TQuery.
>

Thanks to all. I believe it have it now. I've only ever used IBX for a
MD setup and if I remember correctly, that was much like TTable with the
MasterSource property and all.

Thanks again and thanks for the demo project, Hans.

--

Warm Regards,

Lee