Re: Speed issue...
- From: "Atmapuri" <janez.makovsek@xxxxxxx>
- Date: Fri, 15 Jun 2007 12:37:55 +0200
Hi!
I stripped all the code from the procedure that takes most CPU.
Scrolloing the table is then fast, but if I add:
DataForm.MTable.DisableControls;
DataForm.MTable.EnableControls;
These two lines consequently take 2 seconds.
Same for this two lines:
DataForm.MTable.Edit;
DataForm.MTable.Post;
Any editing is slow as hell.
Thanks!
Atmapuri
"Brian Bushay TeamB" <BBushay@xxxxxxxxx> wrote in message
news:toq373tgku0j4m6pcrqmq2cfhmmme68c62@xxxxxxxxxx
About 30 fields, number and text. No blobs, no long strings.
It is constantly slow. I am also using CalcFields event and turning
that off speeds things up by 2x when scrolling the database. Instead
of 1 second it takes about 0.5 seconds to move to the next record.
Each scroll operation executes a new Locate call with 2 indexed fields on
a database with about 3000 records.
DataForm.Table.Locate('LoID;CoID', VarArrayOf([DataForm.LTable['ID'],
DataForm.CTable['ID']]),[]);
Thats where the 0.5 second comes from. All tables here are TAdoTable.
The CalcFields fills four Calculated fields with the sum of 3 other number
fields
from the same record. This is the other 0.5 seconds of the .Next call
cost.
Making an edit is as slow as I mentioned.
Since you are using TadoTable try turning the TableDirect property to
True.
This will have Access use an internal cursor instead of generating a
Select
statement. This is faster for Access. You can also try replacing your
Locates
with Seek if the fields you are locating on are indexed.
Also try disableControls on the table you are locating on and
Enablecontrols
after the locate if you have any controls connected to these tables.
DisableControls adds some speed when moving records even if there are no
controls attached.
If there are any detail tables connected to the table you are scrolling
you
might want to disable controls on them to especially if they are not
visible.
--
Brian Bushay (TeamB)
Bbushay@xxxxxxxxx
.
- Follow-Ups:
- Re: Speed issue...
- From: Brian Bushay TeamB
- Re: Speed issue...
- References:
- Speed issue...
- From: Atmapuri
- Re: Speed issue...
- From: Francois Malan
- Re: Speed issue...
- From: Atmapuri
- Re: Speed issue...
- From: Brian Bushay TeamB
- Speed issue...
- Prev by Date: Re: Speed issue...
- Next by Date: Re: Speed issue...
- Previous by thread: Re: Speed issue...
- Next by thread: Re: Speed issue...
- Index(es):
Relevant Pages
|