Board index » delphi » Speed problems with updating new value to Query detail dataset (cached updates)

Speed problems with updating new value to Query detail dataset (cached updates)

Hello,

I have speed problem with updating new value to specific record
in paradox tables.

I have master table and detail table. I'm working with cached updates and
I'm using FILTER for showing detail records.

So on detail recordset I have some code on CALCFIELDS, which
calculates some calculated fields.

now....

When I want to change some value on detail records, operation for
updateing takes to long.....Even if I have only five detail records..

Code loks like :

  dm1.Q_POSTAVKA.First;
  while not dm1.Q_POSTAVKA.Eof do
   begin
    dm1.Q_POSTAVKA.Edit;
    dm1.Q_POSTAVKARABAT.Value:=odstotek;
    dm1.Q_POSTAVKA.Next;
   end;

Q_POSTAVKA is detail query recordset...

This iteration takes to long. I don't know why...

Can anybody help me ?

thanks                DARKO

 

Re:Speed problems with updating new value to Query detail dataset (cached updates)


Put a break point into while and check, how many times your while goes
through. Is it really 5 times even if you have 5 detail records.
Anyway, you should also see, if you go step by step through code with F8,
where this wile is takeing so long.

Grega!

Quote
Darko Hozjan wrote:
> Hello,

> I have speed problem with updating new value to specific record
> in paradox tables.

> I have master table and detail table. I'm working with cached updates and
> I'm using FILTER for showing detail records.

> So on detail recordset I have some code on CALCFIELDS, which
> calculates some calculated fields.

> now....

> When I want to change some value on detail records, operation for
> updateing takes to long.....Even if I have only five detail records..

> Code loks like :

>   dm1.Q_POSTAVKA.First;
>   while not dm1.Q_POSTAVKA.Eof do
>    begin
>     dm1.Q_POSTAVKA.Edit;
>     dm1.Q_POSTAVKARABAT.Value:=odstotek;
>     dm1.Q_POSTAVKA.Next;
>    end;

> Q_POSTAVKA is detail query recordset...

> This iteration takes to long. I don't know why...

> Can anybody help me ?

> thanks                DARKO

Other Threads