Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Failing master/detail link between TQuerys ?

Status
Not open for further replies.

StevenK

Programmer
Jan 5, 2001
1,294
GB
We make use of standard TQuery components. Both the master and detail TQuerys (as part of linked master/detail queries) have the 'RequestLive' property set to True to allow editing/updating of the data entries as seen.
For instance the SQL of the master TQuery is 'SELECT * FROM PORDHEAD ORDER BY PORDNO' and the detail TQuery has SQL 'SELECT * FROM PORDLINE WHERE PORDNO =:pORDNO'.
This should allow us to scroll through the master TQuery and see the detail TQuery follow suit (such that we see the appropriate lines for the indicated header).
However on occasions we have seen this link fail.
If the SQL for the master is changed to include a WHERE clause, for instance 'SELECT * FROM PORDHEAD WHERE PORDNO =:pORDNO' then the detail TQuery does not seem to follow suit, that is we might close the detail, close the master and then pass it an appropriate parameter (i.e. a purchase number of 10) and then open the master and then open the detail, the detail TQuery still seems to contain the records of the previous master record.
Is this a broken link or should we not be making use of master/detail TQuerys with the 'RequestLive' property set to True ?
Anyone have any thoughts on this ?
Thanks in advance.
Steve
 
Requestlive don't break the link.
Have you set the Datasource property in the Pordline TQuery to the Pordheads Datasource?
 
Yes - the DataSource property of the detail 'qPOrdLine' is set to the master 'qPOrdHead'.
The master-detail relationship sometimes seems to lag, albeit that I close both the TDataSets (master and detail) when I re-open the detail 'qPOrdLine' it sometimes displays the data relating to the previous header I was focussed on.
Anyone have any thoughts as to why I might be seeing this ?
Steve
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top