Master Detail with D6

rcoyle

Member²
I hope that i can get closure on this issue. I am using Delphi 6 with DOA 3.4.6.4 in a 3tier application. I have a foreign key on the detail table. At runtime i create a record in the master and assign a -1 to the master DS keyfield. I add a detail record and i assign this value to the correcponding field in the detail table. When the record posts I get an error ORA-02291: integrity constraint (PMRS.DOCDETAILHEAD_FK) violated - parent key not found. My provider options are popropogatechanges, pocascadeupdates, poincfieldprops. Am I doing something wrong or is there a problem with my version of DOA? I cannot upgrade from D6. Is there anything else I can do?
 
The problem is that the keyfield is not cascading from the master to the detail. FYI the fields in the TOracleDataset are not persistent. I don't know if this matters. I would have tried the 4.X demo but they require the IDE. This error is occuring in the appserver section which does not run out of the IDE.
 
I have worked around this problem by filling in the key fields myself. I ended up doing this both in the client, (newrecord event), and the appserver ( beforeupdaterecord event ). This is the only way that I could ben sure that these fields are filled in properly.
 
Back
Top