Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 2 of 2 total
Thread Master-detail
Sat, Apr 1 2006 4:26 AMPermanent Link

"Stanimir Petkov"
Hi,
When using Query1 and Query2 in a master-detail relationship which is the
best way for fast scroliing of Query1 without refiring Query2 (when it's not
needed).
Something like code bellow, using timer for example 200ms for Query2, or
there is other way.
When there is a big ammount of data, which is the traffic-less and speed way
for master-details - using Queries or using Tables (as addition to previous
post Master-detail vs Filtering)(using server on LAN).
Thanks

procedure TForm1.Query1BeforeScroll(DataSet: TDataSet);
begin
 if not(GV_Query1SubQueries) then
   begin
     Timer1.Enabled:=false;
     if Query2.Active then
       Query2.Close;
     //
     Timer1.Enabled:=true;
     //
   end
 else if (GV_Query1SubQueries) then
   begin
     if timer1.Enabled then
       Timer1.Enabled:=false;
     //
   end;
 //
end;

procedure TForm1.Timer1Timer(Sender: TObject);
begin
 Timer1.Enabled:=false;
 if not(Query2.Active) then
   Query2.Open;
 //
end;


Mon, Apr 3 2006 6:15 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Stanimir,

<< When using Query1 and Query2 in a master-detail relationship which is the
best way for fast scroliing of Query1 without refiring Query2 (when it's not
needed). Something like code bellow, using timer for example 200ms for
Query2, or there is other way. >>

Actually, the timer code that you posted should work quite nicely and give
you the option of controlling how often the detail query refreshes during
navigation.

<< When there is a big ammount of data, which is the traffic-less and speed
way for master-details - using Queries or using Tables (as addition to
previous post Master-detail vs Filtering)(using server on LAN). >>

Tables with master-detail links will be slightly faster, but not by that
much.  So, the answer really depends upon which method you're most
comfortable using.

--
Tim Young
Elevate Software
www.elevatesoft.com

Image