Subject RE: [IBO] Re: Master Detail
Author Olafur Gudmundsson
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@...]
Sent: 15. november 2001 01:01
To: IBObjects@yahoogroups.com
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/