Subject | RE: [IBO] Foreign key |
---|---|
Author | Helen Borrie |
Post date | 2002-08-20T00:05:49Z |
At 07:50 AM 20-08-02 +1000, you wrote:
Looking at your DFM (I don't have BCCPB) I see that you include the FOR
UPDATE clause in the select queries. Try removing that, and your EditSQL
sentence, and see whether it then works. Apart from that the setup looks
right.
Try explicitly listing the columns you want in the sets, rather than using
select *. This is a rule I recommend and follow, since it makes your app
easier to troubleshoot and maintain. (All data in IBO "boils down" to
TIB_Column).
Also, you don't need all those bars. If you set the property ReceiveFocus
to true on a Bar component, then the bar will operate on whichever dataset
has the focus...not that superfluous bar comps should cause any
problems...but it's just a thought that the extra bar comps might be
stepping on the masterlinking in some way.
Another possibility might be that the Keylinks in the detail set don't
uniquely identify a row. Is there any chance of that? Or that the linking
keys are somehow mismatched, e.g. by type, size or case?
Is it possible that your app is forgetting to open the detail set...?
Have you tested the two datasets in IB_SQL in a joined query, to see
whether the master keys actually find the foreign keys in the detail?
You don't say what database version you are using. If it's IB 6.x or
Firebird, could there be some quoted identifiers in there that you overlooked?
Helen
>I have placed my BCB5 sample project and database atSome suggestions:
>http://www.mjfreelancing.com/download/IBOTest.zip
>
>Can someone please have a look at this very simple problem.
>
>Mal
Looking at your DFM (I don't have BCCPB) I see that you include the FOR
UPDATE clause in the select queries. Try removing that, and your EditSQL
sentence, and see whether it then works. Apart from that the setup looks
right.
Try explicitly listing the columns you want in the sets, rather than using
select *. This is a rule I recommend and follow, since it makes your app
easier to troubleshoot and maintain. (All data in IBO "boils down" to
TIB_Column).
Also, you don't need all those bars. If you set the property ReceiveFocus
to true on a Bar component, then the bar will operate on whichever dataset
has the focus...not that superfluous bar comps should cause any
problems...but it's just a thought that the extra bar comps might be
stepping on the masterlinking in some way.
Another possibility might be that the Keylinks in the detail set don't
uniquely identify a row. Is there any chance of that? Or that the linking
keys are somehow mismatched, e.g. by type, size or case?
Is it possible that your app is forgetting to open the detail set...?
Have you tested the two datasets in IB_SQL in a joined query, to see
whether the master keys actually find the foreign keys in the detail?
You don't say what database version you are using. If it's IB 6.x or
Firebird, could there be some quoted identifiers in there that you overlooked?
Helen
>-----Original Message-----
>From: Jason Wharton [mailto:jwharton@...]
>Sent: Tuesday, 20 August 2002 06:55
>To: IBObjects@yahoogroups.com
>Subject: Re: [IBO] Foreign key
>
>
>There is simply something confusing you here. EditSQL should have no bearing
>on whether you can select data in a master-detail setup or not.
>
>Jason Wharton
>CPS - Mesa AZ
>http://www.ibobjects.com
>
>-- We may not have it all together --
>-- But together we have it all --
>
>
>----- Original Message -----
>From: "Malcolm Smith" <mjfreelancing@...>
>To: "IBObjects List (E-mail)" <IBObjects@yahoogroups.com>
>Sent: Monday, August 19, 2002 1:42 AM
>Subject: [IBO] Foreign key
>
>
> > I'm starting out with IBO.
> >
> > I created my first sample master-detail table today in BCB5 and was
>getting
> > a 'cannot use blank SQL statement' (or similar). Looking at demos I could
> > not work out why.
> >
> > After looking at some other sources I found a sample that used an EditSQL
> > statement. I could only get my application to work if I added:
> >
> > update GROUPS
> > set
> > GRP_DESCRIPTION = :GRP_DESCRIPTION
> > where
> > GRP_DESCRIPTION = :OLD_GRP_DESCRIPTION
> >
> > to the EditSQL string in my master query.
> >
> > Why is this ?
> >
> > My database is very basic and I only added the foreign key because from my
> > BDE experiences I thought I needed it. It is not used for anything else
>(at
> > the moment). Can I get rid of it and hence the above SQL statement.
> >
> >
> >
> > Malcolm Smith
> > MJ Freelancing
> > ABN: 30 671 763 146
> > http://www.mjfreelancing.com
> >
> > CORintel
> > ABN: 30 336 110 329
>
>
>
>
>___________________________________________________________________________
>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/
>
>
>
>
>___________________________________________________________________________
>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/