1

I am rewriting an existing BDE database program to use Firebird using the FibPlus components.

Since I almost every where used TQuery components, the change is fairly straightforward.

Apart from one thing I dont't seem to find :

  • In one of my forms I have two grids above each other, linked to TTable components, where the grid below only displays records with the same key as the selected record in the upper grid - so master/detail relationship.

This was done easy in BDE using the MasterSource and MasterFields properties.

How can this be achieved using the FibPlus FibDataset or FibQuery components ?

Edelcom
  • 5,038
  • 8
  • 44
  • 61

1 Answers1

1

I don't think it's possible with a FibQuery, but with a FibDataSet there is a DataSource property which you should point to a DataSource connected to the master DataSet.

In the Detail fibDataSet a where clause shoudl be used where the parameter has the same name as the master field for the detail table in the master table.

For example: master pFibDataSet CustomerspFibDataSet with the following SQL:

select cusotmerid, name, address, country from customers

A master DataSource CustomersDataSource with property DataSet set to CustomerpFibDataSet

detail pFibDataset OrderspFibDataSet with the property DataSource set to CustomersDataSource and the following SQL:

select orderid, date, amount from orders
where customerid = :customerid
evdkraan
  • 171
  • 1
  • 4