|Subject||Re: How do I make ClientDatasets with master/detail relationships work right?|
Sure, what's your Skype handle?
--- In IBObjects@yahoogroups.com, "IBO Support List" <supportlist@...> wrote:
> I'm going to need some extra help with your sample app.
> There are things there that appear quite non-standard to me.
> Perhaps you can contact me on Skype or some other instant messenger?
> -----Original Message-----
> From: IBObjects@yahoogroups.com [mailto:IBObjects@yahoogroups.com] On Behalf
> Of masonwheeler
> Sent: 01 November 2012 04:47 PM
> To: IBObjects@yahoogroups.com
> Subject: [IBO] Re: How do I make ClientDatasets with master/detail
> relationships work right?
> All right. I just added ibo_cds.zip to the Files section on the Yahoo
> group. It's a fairly simple project that allows you to reproduce the
> problem. The database comes pre-populated with a master row that contains
> details referencing it. Try deleting the master row and then applying
> updates back to the data module and you'll see the problem.
> --- In IBObjects@yahoogroups.com, "IBO Support List" <supportlist@>
> > Mason,
> > I don't use them extensively, but I do have some sample applications and I
> > do intend them to work 100%. Will you please make a sample app of your
> > problem so that I can see what is going on?
> > Jason
> > -----Original Message-----
> > From: IBObjects@yahoogroups.com [mailto:IBObjects@yahoogroups.com] On
> > Of masonwheeler
> > Sent: 01 November 2012 11:16 AM
> > To: IBObjects@yahoogroups.com
> > Subject: [IBO] Re: How do I make ClientDatasets with master/detail
> > relationships work right?
> > --- In IBObjects@yahoogroups.com, "masonwheeler" <masonwheeler@> wrote:
> > >
> > > I just ran into a bit of a problem. I've got two TIBOTables, let's call
> > them M and D. The database table for D has a foreign key that points to
> > table.
> > >
> > > I have two TClientDataset instances, one linked to M and one linked to
> > through providers. (Let's call them cdsM and cdsD.) The providers both
> > have ResolveToDataset set to true, which means that when I call
> > ApplyUpdates, the updates should only be sent to the TIBOTable dataset and
> > not to the database.
> > >
> > > Everything works fine until I try to delete a record in cdsM that has
> > records in cdsD pointing to it. I deleted those as well, but when I run
> > following code:
> > >
> > > cdsM.ApplyUpdates(0);
> > > cdsD.ApplyUpdates(0);
> > >
> > > ...which should apply the updates back to the datasets and not to the
> > database, I get a foreign key violation from the database. (And if I were
> > to apply the updates in the opposite order, it would error on inserts to M
> > instead. And this is a UI-driven operation, where it's quite possible to
> > get both inserts and deletes in the same batch of updates.)
> > >
> > > How do I set this up so that I can apply both inserts and deletes from
> > client datasets, and the TIBOTables will delay passing the SQL on to the
> > database until it has all the necessary information it needs to handle
> > things in the proper order? (Delete from D before M, insert to M before
> > ...anyone? I can't be the only one who's ever tried to use IBO with
> > datasets.