Results 1 to 5 of 5

Thread: Problem with long procedure

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2001
    Posts
    72

    Problem with long procedure

    Hello,

    I have a procedure that imports a file into a DB and it could take up to 30 seconds to complete the procedure.

    When the user executes this procedure, moves to another program that is open, then come back to the VB program, the VB program doesn't respond (freezes) until the procedure is over.

    How do I get the form to not "freeze"?

    Thanks in advance.

    ttlai

  2. #2
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    try placing DoEvents in the loop if you have a loop coded. otherwise, put doevents right before the function call you are doing that is taking so long.
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  3. #3
    Frenzied Member ae_jester's Avatar
    Join Date
    Jun 2001
    Location
    Kitchener Ontario Canada Earth
    Posts
    1,545
    You need to add doevents within the procedure, which executes all events before continuing, such as mouse moves, form activate events etc.

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Jan 2001
    Posts
    72

    thanks guys

    thanks, that was quick.

  5. #5
    Software Eng. Megatron's Avatar
    Join Date
    Mar 1999
    Location
    Canada
    Posts
    11,286
    Here's a link to some code that supposed to act like "DoEvents" but twice as fast.

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