Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

how to set master detail on ADOQuery

edited July 2001 in General
1. How do I set up the master detail relationship between ADODataset or
ADOQuery?
I do not see the mastersource property, only the masterfield.

2. How do I start printing the detail report on the same line right after
the master record.
for example, a Customer and Order report

customer st order date order no
-----------------------------------------------------------
ABC NY 1/4/2001 200011
1/6/2001 200022

BAC CA 1/3/2001 200002
5/3/2001 200282

Comments

  • edited July 2001
    From the Delphi help file on the datasource property:

    property DataSource: TDataSource;

    Description

    Set DataSource to automatically fill parameters in a query with fields
    values from another dataset. Parameters that have the same name as fields in
    the other dataset are filled with the field values. Parameters with names
    that are not the same as fields in the other dataset do not automatically
    get values, and must be programmatically set. For example, if the SQL
    property of the TADOQuery contains the SQL statement below and the dataset
    referenced through DataSource has a CustNo field, the value from the current
    record in that other dataset is used in the CustNo parameter:

    SELECT *

    FROM Orders O

    WHERE (O.CustNo = :CustNo)
    ...


    Cheers,

    Jim Bennett
    Digital Metaphors


This discussion has been closed.