Results 1 to 4 of 4

Thread: Speed?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2000
    Location
    Australia
    Posts
    69

    Angry

    Hi guys ...major problem I would like to question the community on!

    I have a app that connects to a MS Access97 database. I believing I'm using ADO to do this. I have a form that has a tab control on it and the form is poulated with about 40 feilds. I have about 10 adodc controls that are hooked to 10 dbCombo boxes. I have a lot of validation occuring as the user moves from record to record. There only about 50 - 100 records been pulled back again using a ADODC control.

    The problem is it takes about 3sec to move from record to record. I load all my combo boxes as the form loads therefor its not trying to load the combo boxes all the time. The validation is basically making certain controls and text boxes invisible depanding on the value in certain combo boxes. Is there a better stategy to speed things up?????


    Regards


    Gerard

  2. #2
    Member
    Join Date
    Jan 2000
    Location
    Quantico, VA, USA
    Posts
    41
    gerard,

    I've got some ideas for you. try to subdivide your form into frames and separate the data according to what items are visible together. that way, you can just turn the frame invisible when you need to, vice versa.

    also, you have 40 unique fields? ten combo boxes? sounds like a pretty big project. see if you can split some of that stuff up to more than one form. why don't you throw some code for one of your combo boxes out here so we can better see what the problem is?

    chuck
    To err is human, but to apologize frequently is embarassing.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jul 2000
    Location
    Australia
    Posts
    69

    Unhappy

    Here is an example of code I use to populate my combo boxes

    strInsertby = "SELECT * FROM [ListInsertedBy] Order by InsertedBy"


    With AdInsertby 'ADODC control
    .ConnectionString = cndata
    .CommandType = adCmdText
    .EOFAction = adDoMoveLast
    .RecordSource = strInsertby
    .Refresh
    End With

    I then set up the datasource and row source within the dbCombo control.

    Gerard
    Live long and prosper...

  4. #4
    Member
    Join Date
    Jan 2000
    Location
    Quantico, VA, USA
    Posts
    41
    pay careful attention to how often you loop through your combo boxes for checks. are all the clicked events the same (for each combo box)? can you post some of that code too?

    guess: you are checking each of the combo boxes to determine which element is selected and based on the states of all of the boxes, you determine which controls should be visible. are you checking which controls are already visible? if you are, don't bother. it will take you almost as much time to check them all as it would to go ahead and change them.

    if you only load the dbcombos once, then your problem is not data access oriented. you are performing way too many checks. use boolean logic to cut down on this. ie. these three are the same.

    1) Not optimal for our purposes:
    if <condition1> or <condition2> and <condition3>
    <do this>
    elseif <condition1> or <condition2> and not <condition3>
    <do this>
    end if

    2) Optimal if you only need to use the 'or' test once:
    if <condition1> or <condition2>
    if <condition3>
    <do this>
    else
    <do this>
    end if
    end if

    3) Optimal if you need to use the 'or' test more than once to avoid reevaluating the condition:
    bTest = <condition1> or <condition2>
    if btest and <condition3> then
    <do this>
    else
    <do this>
    end if

    hopefully some of this will help. i mention the boolean thing because it's a mistake i make often and have to correct.

    chuck
    To err is human, but to apologize frequently is embarassing.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width