Subject [IBO] Re: Master Detail
Author Marco Menardi
I'm experimenting with Tutorial transaction, lesson 2.
There is something strange when using grids.
With the dataset closed, you can enter fields in the grid and post.
The dataset remains close. When you commit the changes are committed,
the dataset is still closed but grid shows the record just entered, so
I thought that the caClose was not working...
Are you generating some important field of the detail (i.e. primary
key) on the database side (i.e. using a generator without using the
GeneratorLink of the detail query)? Disappearing details are often due
to impossibility by IBO of uniquely retrieving the posted record...
my ICQ is 136812545
Regards
Marco Menardi

--- In IBObjects@y..., "Olafur Gudmundsson" <olafurgu@h...> wrote:
> The detail query is open and yes the Commitaction is caClose and
here is how
> I open the two query's every time the form gets opened.
> ----------
> procedure TfrmFyrirtaeki.FormCreate(Sender: TObject);
> begin
> if not DM2.TActionFyrirtaeki.InTransaction then
> DM2.TActionFyrirtaeki.StartTransaction;
>
> with DM2.qryMaster do
> begin
> Close;
> Prepare;
> Open;
> end;
>
> with DM2.qryDetail do
> begin
> Close;
> Prepare;
> Open;
> end;
> ----------------------
> The strange thing is that after I close and reopen the form I can
Insert
> Detail records but they disapear and I don't see any detail records
then
> browsing. But if I close the application and run it again then I
see the
> detail records.
>
> Regards
> Olafur
>
> -----Original Message-----
> From: Marco Menardi [mailto:mmenaz@l...]
> Sent: 15. november 2001 01:01
> To: IBObjects@y...
> Subject: [IBO] Re: Master Detail
>
>
> Since you seem desperade, I give you some (stupid?) ideas, but I did
> not think about them the necessary time.
> Maybe the detail query is simple cose. Query.CommitAction maybe is
> caClose, you open it when you create the datamodule, after a commit
it
> gets closed and the second time you open the form it does not work
> anymore.
> With the debugger (ctrl+F7) inspect the value of some dataset's
> property. Add some IBO bars on the form and chain them with the
> datasets just to have a visula clue of what is carrying on
(tansaction
> bar, dataset bar). Let me know.
> Regards
> Marco Menardi
>
> --- In IBObjects@y..., "Olafur Gudmundsson" <olafurgu@h...> wrote:
> > Hi, I'm having this big problem with Master Detail rel.
> >
> > The situation is:
> > 1. I have one transaction comp. and two ib_query comp. and two
> datasource
> > comp.
> > 2. The PK in the master is of type string and so is the FK in the
> detail
> > table.
> > 3. The PK in the detail table is a integer and is generated on the
> IB6.
> > 4. I control the transaction my self. I start it when I create
the
> form and
> > I make a hard Commit when I close the form, I use Isolation
> > "Concurrency(Repeatable Read)" and Autocommit = false.
> > 5. The program is a MDI and the form is one of the child forms.
> > 6. All my child forms are created when needed except my main form
> and my
> > datamodule (where I keep my trans. and query's).
> >
> > The problem is:
> > 1. When I open my form for the first time everything is working
ok.
> I can
> > browse and insert and browse and everything is ok.
> > 2. But when I close(Action := caFree; frmFyrirtaeki := nil;) the
> form and
> > then open it again the detail query seem to have lost the
connection
> to the
> > master.
> > 3. So when I browse the master the detail query is not working.
> >
> > I think I have tried just about everything (I going nuts) and I
hope
> some
> > one can help me out here.
> >
> > Regards
> > Olafur
>
>
>
>
______________________________________________________________________
_____
> IB Objects - direct, complete, custom connectivity to Firebird or
InterBase
> without the need for BDE, ODBC or any other layer.
>
______________________________________________________________________
_____
> http://www.ibobjects.com - your IBO community resource for Tech Info
papers,
> keyword-searchable FAQ, community code contributions and more !
>
> Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/