Subject OK to Set MasterLinks at run time?
Author andrewgarner@garnernet.co.uk
I'm having difficulty when setting IB_Query.MasterLinks
and .MasterSource at run time. (My motivation is to re-use existing
datasets, rather than let them proliferate too much).

The links give the expected results when I set them in the query
editor in the IDE, but when I try the same thing through code at
runtime the detali dataset seems to stay closed.

Here's my most recent iteration (Address is the Master and JobHeader
the Detail, ie there can a many jobs for one address):

qryAddress.Close;
qryJobHeader.Close;

qryJobHeader.MasterLinks.Clear;
qryJobHeader.MasterSource := nil;

qryJobHeader.MasterLinks.Add('JobHeader.AdId=Address.AdId');
qryJobHeader.MasterSource := dtsAddress;

qryAddress.Prepare;
qryAddress.Open;
qryJobHeader.Prepare;
qryJobHeader.Open;

I just need a shove in the right direction please - should this work
or not? are there other / better techniques? should I just use more
datasets? do I need the Close/Reopen?

Many Thanks, Andy Garner