Page 1 of 1

Constraint Problem

Posted: Mon 23 Jun 2008 09:04
by charbel
im facing problem in master(MT)/detail(DT) tables:
journal (MT) --> journaldt (on journal_id)-----------------> cstjour (on journaldt_id).

im using the ApplyUpdate method cause there is constraint on tables.
but when filling journaldt and then cstjour, and try to insert another row in journaldt, the previous rows in cstjour are missed.
this is how i used the applyupdates:

after post journal table:
Try
journaldt.ApplyUpdates;
Cstjour.ApplyUpdates;
Database.commit;
Except
journaldt.RestoreUpdates;
Cstjour.RestoreUpdates;
Database.Rollback;
end;
journaldt.CommitUpdates;
Cstjour.CommitUpdates;


can u help please?

Posted: Mon 23 Jun 2008 12:43
by Dimon
Please send a complete small sample to dmitryg*devart*com to demonstrate this problem, including a script to create and fill table.

Posted: Mon 23 Jun 2008 15:05
by charbel
i sent u mail as ur request. waitin ur reply.

Posted: Tue 24 Jun 2008 11:00
by Dimon
When establishing master-detail relationship the CachedUpdates property of detail dataset works properly only when TCustomDADataSet.Options.LocalMasterDetail is set to True. Therefore you should set the Chkjour.Options.LocalMasterDetail property to True.
You can find more detailed information about this in the MyDAC help.

Posted: Tue 24 Jun 2008 11:29
by charbel
10x dimon.