Master-detail relationship

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Tolik
Posts: 4
Joined: Wed 26 Nov 2008 17:42

Master-detail relationship

Post by Tolik » Wed 26 Nov 2008 18:03

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

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Fri 28 Nov 2008 12:36

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.

Tolik
Posts: 4
Joined: Wed 26 Nov 2008 17:42

Post by Tolik » Sat 06 Dec 2008 10:06

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.

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Mon 08 Dec 2008 09:28

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.

Tolik
Posts: 4
Joined: Wed 26 Nov 2008 17:42

Post by Tolik » Mon 08 Dec 2008 11:46

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

Post Reply