Totte Karlsson
Totte Karlsson

Reputation: 1341

Update of a VCL TClientDataSet (detail set) when its master data set is empty

I have a master TClientDataSet, which is also a detail dataset. This dataset is named MasterDetail1.

Another dataset, DetailSet1, is a detailset of the MasterDetail1.

The query for DetailSet1 is

SELECT * 
FROM readoutprobe_containers 
WHERE id = :parent_container

Where the value of the parent_container parameter is obtained through a DataSource getting its data from the master data set.

As long as the MasterDetail1 dataset has more than one record, the DetailSet1 dataset shows appropriate data.

However, when the MasterDetail1 dataset is empty, the DetailSet1 dataset shows the last populated record from the MasterDetail1 data, which is wrong data. When the master set got no data, the detailset should show no data as well.

How to achieve an empty DetailSet1 when its master data is empty?

Upvotes: 7

Views: 108

Answers (0)

Related Questions