Master/Detail events are not firing properly

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Japhar
Posts: 38
Joined: Thu 05 Oct 2006 04:22

Master/Detail events are not firing properly

Post by Japhar » Fri 16 Feb 2007 07:10

Hi,

We are having SDAC source code of 3.80.0.32.

I observed that Master/Detail events are not firing properly.
So i just modified code in dbaccess.pm file.

Can you please confirm that the code which i have written will effect any where. I'm just closing and opening a dataset to fire the events of detail query component.


In a procedure "TDADetailDataLink.ActiveChanged" added below code

if FDataSet.Active and
not (csDestroying in FDataSet.ComponentState) and Active then
begin

// Added code Close/Open, so events of Detail Query will get fire
if ((FDataSet nil) and (FDataSet.Active) and (FDataSet.State dsSetKey)) then
begin
FDataSet.Close;
FDataSet.Open;
end;
//End Adding.


FDataSet.RefreshParams;

Please confirm......

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Fri 16 Feb 2007 10:19

Please describe the reason of suggested fix more detailed. What events do you mean?

Japhar
Posts: 38
Joined: Thu 05 Oct 2006 04:22

Post by Japhar » Fri 16 Feb 2007 11:04

1. I have a x query with x datasource in x data module

x query: select c1, c2,c3 from xyz

2. I have y query in y data module

y query: select a1,a2,a3 from abc where a4=:c1
c1 is the input parameter which it gets from x query.
For that i set the Master data source of y query with x.

4. For y query i have written an After open event in y data module.

5. When i try to open x query then it needs to fire afteropen event of y query in y datamodule. which is not happing.

For that i have modified code in DBAccess.pas file and it works....

Is this information is OK...or more information is required. I found the above scenario in my project. I have not created a new project to check the above scenario....

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Fri 16 Feb 2007 14:11

Thank you for your suggestion. We will think about supporting such events in the next MyDAC version.
By the way, implementing your suggestion would not be optimal because it leads to a double server roundtrip (both on Open and on RefreshParams).

Japhar
Posts: 38
Joined: Thu 05 Oct 2006 04:22

Post by Japhar » Fri 16 Feb 2007 14:35

Thanks for your response.

But can you please let me know how much time should we need to wait? approximatly....

Can you please let me know the change which i made will leads to any unexpected results in someother scenarios???

Because i have tested few screens in my project after my change and the functionality works as expected else i have look for work-around.
:cry:

Please let me know your comments on this....

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Fri 16 Feb 2007 15:37

> But can you please let me know how much time should we need to wait? approximatly....
We are considering including this fix in one of builds of MyDAC 5.

> Can you please let me know the change which i made will leads to any unexpected results in someother scenarios???
There should not be any problems using this code with SDAC. But this code will probably not work with the other Core Lab Data Access Components (MyDAC, ODAC, IBDAC). The DBAccess unit is a common unit for the DACs.

Japhar
Posts: 38
Joined: Thu 05 Oct 2006 04:22

Post by Japhar » Sat 17 Feb 2007 10:45

I really thanks for your response...

Post Reply