Edelcom
Edelcom

Reputation: 5058

How to use MasterSource and MasterFields capability using FibPlus datasets or FibQuery

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 :

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

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

Upvotes: 2

Views: 3309

Answers (1)

evdkraan
evdkraan

Reputation: 181

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

Upvotes: 2

Related Questions