Subject | MasterDetail - Again |
---|---|
Author | chirug2003 |
Post date | 2004-08-14T01:46:45Z |
I'm still struggling to come to grips with the behaviour of
TIBOxxxxx components when using Master-Detail. I'm new to SQL and
have no experience with IBO. Have recently obtained Helen Borrie's
excellent book and have a pretty good grasp of the fundementals of
DB modelling.
I've bought and read Getting Started Manual and looked at the Online
FAQ's but cannot get the relationship to work the way I think they
should - I'm obviously missing something very basic here.
Example: (Experimental - learning only)
Drop TIBConnection and TIBTransaction on form. Make
TIBTransaction 'join' to TIBConnection.
2 small tables master-detail using TIBOTables and IP Grids.
Master-Detail linked through MasterSource and MasterFields properties
Can scan through previously enter Master records and see the
corresponding detail records.
In master table grid enter a complete master record - but do not
post it
Move to detail table grid and enter detail fields - MasterID field
automatically contains current (as yet unposted) MasterID from
Master table. All fields contain values. Now attempt to post the
detail record. This fails since linked master record has not been
posted therefore the FK constraint fails.
This is where my misunderstanding of what should happen comes in:-
From my reading I thought that IBO would perform a Postretaining on
the newly inserted but as unposted Master record THEN would post the
detail record and then finally perform an update on the Master
record. In this way avoiding the missing Master record problem.
I've put message statements for debugging purposes in all of the
transaction's events - none of them fire and display my message.
The onError event does fire.
Have I totally misunderstood what's supposed to happen?
Thanks
Peter
TIBOxxxxx components when using Master-Detail. I'm new to SQL and
have no experience with IBO. Have recently obtained Helen Borrie's
excellent book and have a pretty good grasp of the fundementals of
DB modelling.
I've bought and read Getting Started Manual and looked at the Online
FAQ's but cannot get the relationship to work the way I think they
should - I'm obviously missing something very basic here.
Example: (Experimental - learning only)
Drop TIBConnection and TIBTransaction on form. Make
TIBTransaction 'join' to TIBConnection.
2 small tables master-detail using TIBOTables and IP Grids.
Master-Detail linked through MasterSource and MasterFields properties
Can scan through previously enter Master records and see the
corresponding detail records.
In master table grid enter a complete master record - but do not
post it
Move to detail table grid and enter detail fields - MasterID field
automatically contains current (as yet unposted) MasterID from
Master table. All fields contain values. Now attempt to post the
detail record. This fails since linked master record has not been
posted therefore the FK constraint fails.
This is where my misunderstanding of what should happen comes in:-
From my reading I thought that IBO would perform a Postretaining on
the newly inserted but as unposted Master record THEN would post the
detail record and then finally perform an update on the Master
record. In this way avoiding the missing Master record problem.
I've put message statements for debugging purposes in all of the
transaction's events - none of them fire and display my message.
The onError event does fire.
Have I totally misunderstood what's supposed to happen?
Thanks
Peter