[Lazarus] Master-detail-subdetail

Koenraad Lelong lazarus1 at de-brouwerij.be
Tue Jan 4 16:09:06 CET 2011


Hi,

I have a database (firebird) with master-data, detail-data and
sub-detail-data.
In lazarus 0.9.28.2, svn 22279, I defined a TIBConnection, a
TSQLTransaction and three TSQLQuery's. The detail has as its datasource
a datasource coupled with the master. The subdetail has as its
datasource a datasource coupled with the detail.
To show the data I have three TDBGrids, their datasources are those
three datasources coupled with the three queries.

When I start the application, the master that shows has several details,
each having several sub-details. When I scroll the details, the
subdetails follow the detail. That's good. But when I scroll the master,
only the details follow, the subdetail-grid goes blank.

To try finding what happens I added a button that opens the
sub-detail-query. If I click on it I get the expected subdetails. When I
scroll the master again, the subdetail disappears again. Again I can get
it back by clicking my debug-button.

To debug this further, I added events for beforescroll, afterscroll,
beforeclose and beforeopen for all three queries which write to a
logfile. It seems that the beforeclose event is not fired for the
subdetail-query, although it is closed somehow.

I hope this makes sense to someone. Is there anything I'm missing ? Or
have I found a bug ?
If you need more info, please ask.

TIA

Regards,

Koenraad Lelong.




More information about the Lazarus mailing list