Page 1 of 1

Master-detail relationship

Posted: Wed 26 Nov 2008 18:03
by Tolik
Using UniDAC 1.20.0.12
I have few questions of master-detail relationship.

1. How can I intercept or cancel assigning parameters to a detail query? I want in some cases to assign values to parameters manually even if there are parameters with same names as field names in a master query.
2. Does it work TParam.Bound mechanism (like in BDE components)?
3. How can I know that detail query refreshed by scrolling operation in master query?

Thanks,
Tolik

Posted: Fri 28 Nov 2008 12:36
by Plash
UniDAC does not support canceling of assigning parameters of a detail query. The Bound property is used in UniDAC to support default parameters of stored procedures and cannot be used for master-detail.

You can use the AfterRefresh event of a detail dataset to know when it is refreshed by scrolling in a master dataset.

Posted: Sat 06 Dec 2008 10:06
by Tolik
One problem discovered when using master-detail-subdetail (TUniQuery, LocalMasterDetail = False).
If detail query is empty then subdetail reopens 2 times.
Problem found in SetMasterParams method, before AssignField call a parameter value = Unassigned, after AssignField call the parameter value = Unassigned, that's why VarIsEqual condition gives False.

Posted: Mon 08 Dec 2008 09:28
by Plash
We could not reproduce the problem. Please send to unidac*devart*com a complete small sample that demonstrates the problem, including the script for creating database objects.

Posted: Mon 08 Dec 2008 11:46
by Tolik
Sorry.
I couldn't reproduce the problem in origin TUniQuery, too.
Question is closed, and no such problem with origin TUniQuery.

The problem is related to:

I created TUniQuery descendant (emulating BDE TQuery behaviour, particularly detail query close/open calls after master query scroll) and overrode DataEvent method to handle deDataSetScroll and deDataSetChange events. Because of inherited DataEvent call, RefreshParams method call occurs and accordingly checking and assigning params from master to detail (in SetMasterParams).
I solved the problem created by me :).

Thanks