Constraint Problem

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
charbel
Posts: 15
Joined: Fri 02 May 2008 06:42

Constraint Problem

Post by charbel » Mon 23 Jun 2008 09:04

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?

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Mon 23 Jun 2008 12:43

Please send a complete small sample to dmitryg*devart*com to demonstrate this problem, including a script to create and fill table.

charbel
Posts: 15
Joined: Fri 02 May 2008 06:42

Post by charbel » Mon 23 Jun 2008 15:05

i sent u mail as ur request. waitin ur reply.

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Tue 24 Jun 2008 11:00

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.

charbel
Posts: 15
Joined: Fri 02 May 2008 06:42

Post by charbel » Tue 24 Jun 2008 11:29

10x dimon.

Post Reply