Link to home
Start Free TrialLog in
Avatar of ginsonic
ginsonicFlag for Romania

asked on

Speed my table opening

I use in application two tables and two radio buttons .
When I click first button I open ... two databases in tables and when click the second button ....replace these with anothers .

When click the second radio button I pop-up a menu,too :

  Table2.Close;
  Table1.Close;
  Table1.TableName:=Path+'Database\gratuit.dbf';
  Table1.IndexName:='Gratuit';
  Table2.TableName:=Path+'Database\gratuit.dbf';
  Table2.IndexName:='Gratuit';
  Table2.Open;
  Table1.Open;
  Menu.AutoPopup:=True;
  Menu.Popup(0,0);

When run for the first time my app I have a 4-5 seconds delay before pop-up the menu .
Close the program .

Every time when I start the app after that the pop-up is displayed instantly .

How can I remove this delay for the first running ?
Avatar of Alone
Alone

IMHO, you must write a small dummy application like Microsoft OSA (form MS Office) which will slow down end-user computer during startup and ;-) maybe entire session :-))
Avatar of aikimark
You might not be able to remove the delay.  It is most likely caused by DLL loading and BDE initialization.  Once that has been done, subsequent executions don't experience that overhead.

You might be able to mask the delay by invoking some similar process during application startup (with a 'splash' form).  Also, you might this initialize task happen when the user is inactive or reading form content.
when you open the table, bde create temporary table on the memory (or harddrive ?), it always slow on the first time, but you can try to optimize in the BDE Administrator (in the control panel), go to the "Configuration" tab > System > INIT, try to modify all the property, like MTS SPOOLING.

Some time I use TQuery instead of TTable, I find it faster.

Regards
Adeng
you can't

as aikimark commented,
its because the bde
must initialze itself and
this take a bit time

i usual use a splash-screen,
as aikimark suggested,
with a nice picture and a bit text
(like tip of the day)

meikl ;-)
Avatar of ginsonic

ASKER

But the BDE is already initialize because at OnCreate I already have opened anothers tables.

 Table1.TableName:=Path+'Database\compens.dbf';
 Table1.IndexName:='Gratuit';
 Table2.TableName:=Path+'Database\Compens.dbf';
 Table2.IndexName:='Gratuit';
 Table2.Open;
 Table1.Open;
if it already initialized,
and you've already a delay,
then raise the memory-entries at the
bdeadmin-configuration-system-init

ASKER CERTIFIED SOLUTION
Avatar of kretzschmar
kretzschmar
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
appendix

if you've a single-user app,
open your tables with the exclusiv-property set to true

referenced to point 6 above

meikl ;-)