+ Reply to Thread
Results 1 to 5 of 5

Showing a progress bar while connecting to MS Access Database

  1. #1
    Registered User
    Join Date
    11-02-2012
    Location
    india
    MS-Off Ver
    Excel 365
    Posts
    2

    Showing a progress bar while connecting to MS Access Database

    Cross-posted at https://www.mrexcel.com/board/thread...abase.1208095/

    Dear Experts,

    I am creating an excel tool that connects with an MS Access database stored in a remote location. Generally, it takes around 10 seconds ( sometimes faster depending on the internet speed) to run the query and get results back to the excel sheet. Currently, the form and the excel window freeze with a circle cursor which may falsely indicate that Excel is stuck or not responding.

    Is there a way to show a form with a progress bar while the connection with MS Access is made and SQL query is being run? I do not want to show "please wait" message in the Excel status bar.

    I want to show a progress bar when excel processes the following lines

    Please Login or Register  to view this content.
    I tried searching for answers, but all solutions catered to different scenarios. Any help will be much appreciated. Thank you.

    Disclaimer: This question has been cross-posted for a quicker help. I need help as soon as possible. Thanks a lot to the whole community for being so helpful.
    Last edited by 6StringJazzer; 06-16-2022 at 05:21 PM. Reason: Cross-posted added to first post to reset thread as "unanswered"

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,735

    Re: Showing a progress bar while connecting to MS Access Database

    There are two problems with what you want to do. The one that really matters is that VBA is single-threaded and the recset.open call is synchronous. That is, once this line of code starts to execute, VBA can't execute anything else until it returns. A progress bar is used when you have a loop in your code to do some work, and you update the progress bar each time through the loop.

    (The second one is a moot point--even if you could display and update a progress bar, there is no way to tell how much progress is actually being made.)

    The best you can do is show a modeless form that says "Query in progress". It can't show the actual progress to give the user a sense of how much is left to do.

    [Also posted at cross-post location]
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Contributor
    Join Date
    02-25-2022
    Location
    Dallas, Texas
    MS-Off Ver
    Office 365
    Posts
    174

    Re: Showing a progress bar while connecting to MS Access Database

    I looked at this years ago. There is no direct way to do this. In general, ping time is a major factor in time? It greatly depends if the machine is loaded. I looked at other servers like PostgresSQL and SQL Server. They worked a little better but Access did surprisingly well.

  4. #4
    Registered User
    Join Date
    11-02-2012
    Location
    india
    MS-Off Ver
    Excel 365
    Posts
    2

    Re: Showing a progress bar while connecting to MS Access Database

    Thank you both for your replies. 6StringJazzer, thanks for the insights and great idea. I tried that and it worked like charm.. I used a "Connecting...." GIF image and used a Microsoft WebBrowser control to play it in a UserForm. I loaded this and my original userform as modeless (vbModeless) and it solved the purpose.

    Thank you so much for your help.

  5. #5
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,735

    Re: Showing a progress bar while connecting to MS Access Database

    Glad you were able to take my idea and turn it into your needed solution. Thanks for the rep.

    If your question has been answered please mark your thread as "Solved" so that members will know by looking at the thread title that your problem is solved. Go to the menu immediately above your first post to the thread and click on Thread Tools. From the dropdown menu select "Mark this thread as solved..."

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. copy data from one access database to another access database
    By aman1234 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-21-2014, 09:03 AM
  2. Replies: 2
    Last Post: 07-05-2013, 09:37 AM
  3. connecting progress bar to ok button on userform
    By samz93 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-11-2013, 05:40 AM
  4. Need help showing progress bar
    By dontke in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-04-2012, 09:50 AM
  5. VBA: Progress bar not showing
    By kcjones242 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-14-2011, 12:54 PM
  6. Connecting to Access Database
    By toveyj in forum Excel General
    Replies: 0
    Last Post: 11-24-2009, 11:48 AM
  7. Connecting to a database
    By cmpcwil2 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-30-2006, 08:55 AM

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1