Optimize Form Load/Show
Posted on 2001-07-18
I'm using VB6 against an SQL Server 7 database.
My boss would like to optimize the app or at least speed up the executable so the launching of the main form or form.show would be quicker.
The program is written with ADO so there are a lot of recordsets; the DSN is hard-coded so I don't think that's taking up too much time to make the connection.
There are some OLE objects so I know they tend to eat up memory.
Can anyone give some basic tips or tricks to increase the startup speed?
Is there somewhere that I could go thru a checklist to verify some coding standards.
Here's some more detail:
My main startup form is actually a bas module that declares and sets all the ADODB recordsets; i.e. Instantiate and set References to about 20 recordsets.
(My boss did a lot of Access programming, so it's similar to that where the bas module gets executed first.)
Our Form_Load simply contains all of the text boxes that should be enabled/disabled and command buttons that should be visible/invisible.
I think the Form_Initialize and Form_Activate methods get called before Form_Load, right?
So, couldn't I jam some code in there to speed up the launch of the application?
Maybe put the setting of the recordsets in the Form_Initialize event would speed it up?
I just want to make sure that my code is optimized; I'm running Windows NT, PIII 350, and 128 MB RAM, and it seems very slow to display the main form.
Trouble is, the users only have 64 MB RAM.
I know this probably isn't enough info to tell me where to place the code, but I was thinking it could be optimized.
Any help would be appreciated.
Thanks in advance.