duplicate queries
Posted: Thu 29 Jul 2010 09:33
Hi,
I am relatively new in using myDac VCL components and I have a problem: I use a MyQuery -> TClientDataset to populate a Grid. The code is similar with this:
MyQuery1->SQL->Text = "Select * from table1";
if(MyQuery1->Active == false)
MyQuery1->Active = true;
if(ClientDataSet1->Active==false)
ClientDataSet1->Active=true;
ClientDataSet1->Filter = "field1 = 'dummy'";
ClientDataSet1->Filtered = true;
ClientDataSet1->Refresh();
The problem is that after ClientDataSet1->Refresh() it is queried two timesthe server with exactly the same query( I see it with dbMonitor). I don't understand why. Can anyone give a solution to overcome this problem?
Thanks in advanced,
Geanni
I am relatively new in using myDac VCL components and I have a problem: I use a MyQuery -> TClientDataset to populate a Grid. The code is similar with this:
MyQuery1->SQL->Text = "Select * from table1";
if(MyQuery1->Active == false)
MyQuery1->Active = true;
if(ClientDataSet1->Active==false)
ClientDataSet1->Active=true;
ClientDataSet1->Filter = "field1 = 'dummy'";
ClientDataSet1->Filtered = true;
ClientDataSet1->Refresh();
The problem is that after ClientDataSet1->Refresh() it is queried two timesthe server with exactly the same query( I see it with dbMonitor). I don't understand why. Can anyone give a solution to overcome this problem?
Thanks in advanced,
Geanni