Dbx + ClientDataSet master-detail - deleted record reappear on detail dataset

Dbx + ClientDataSet master-detail - deleted record reappear on detail dataset

Post by Dennis H » Tue, 27 Apr 2004 13:31:59


Scenerio:
1. SQLDataSet1 -> DataSetProvider -> ClientDataSet1 -> DataSource1
2. SQLDataSet2 -> DataSetProvider -> ClientDataSet2 -> DataSource2
3. ClientDataSet2.MasterSource := DataSource1
ClientDataSet2.MasterField := MastetKey1
4. ClientDataSet1 have 3 records.
5. For each record of ClientDataSet1 (master), there are 3 records in
ClientDataSet2 (details).

Problem:
1. Position first record in ClientDataSet1 (master).
2. Delete all records from ClientDataSet2 (detail).
3. In ClientDataSet1 (master), go to the next record and then go back to the
first record.
4. The deleted records from ClientDataSet2 (detail) reappear ?????
5. The problem will only occurs when all detail records are deleted, if
there are one or more record still in detail dataset, the problem will not
exists.

Please help me on how to fix the problem.

Thanks.