Subject Re: [IBO] Master-Detail POST problem: REF0 is a required field
Author G. Nau
Hellen,
I've digged through your list and hints to identify the problem but failed. So i decided
to try the final method:
Delete both queries and recreate them from scratch.
Now it's working on inserts.
So it looks like I'd completely fubar'ed the old query properties.

Thanks
Gunther

Am 28 Nov 2005 um 8:59 hat Helen Borrie geschrieben:

> At 04:23 PM 27/11/2005 +0100, you wrote:
> >I'm wokring on this problem for a while now, maybe somebody here
> >on the list can give me a hint ...
> >
> >In a master-detail relationship of IB_Queries, I'm always getting the
> >error "REF0 is a required field" when I try to post an insert to the
> >detail table.
> >But the values of the detail set are all set...
>
> Send more information, such as:
>
> =========================================
> What are the primary keys of the master and the detail?
> What is the foreign key of the detail?
>
> Tell us your actual settings for:
>
> ---the Mastersource and Masterfields properties of the detail.
> ---the Keylinks property of the detail
> ---any custom SQL for the detail's DML (InsertSQL)
>
> Tell us how the value of Ref0 is being assigned.
>
> Any other settings in either dataset that might be relevant, e.g. ReadOnly,
> GeneratorLinks
>
> Place a monitor into your app and show us the output produced when you post
> the detail.
> =========================================
> >Here's a short test probedure I use to check the critical values and
> >submit a post:
> >
> > With IB_Query_AAW_Rechnung do //that's the detail query
> > Begin
> > allocconsole;
> > writeln('AAW_Rechnung.ref0:',fieldbyname('ref0').asinteger);
> >//FK to the master dataset
> > writeln('AAW_Rechnung.ref :',fieldbyname('ref').asinteger);
> >//PK of the detail table; generation definied for this in the
> >IB_connection
> > if Modified then Post; //<- this is failing with REF0 is a required
> >field
> > End;
> >The Writeln shows, that both values are set in the dataset
> >AAW_Rechnung.ref0:71896
> >AAW_Rechnung.ref :25894
> ==========================================================
> This at least says that something is happening to null out Ref0 during the
> Post sequence. The question is: what? What immediately comes to mind is
> that Ref0 is not, on its own, the primary key, but is part of a composite
> primary key on the detail table; and/or that possibly the master has a
> composite primary key that is not fully linked from the detail's Masterfields.
>
> Helen
>
>
>
>
>
> ___________________________________________________________________________
> 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 !
> Yahoo! Groups Links
>
>
>
>
>
>







___________________________________________________________
Gesendet von Yahoo! Mail - Jetzt mit 1GB Speicher kostenlos - Hier anmelden: http://mail.yahoo.de