views:

699

answers:

3

If am getting a Data from the Database from start date to end date – at that time, I want to display progress bar like “Process please wait” How can I write a code? Need Help?

+2  A: 

Steps of geting data from db:

  1. app send query to db
  2. db analyzes query and prepares result
  3. db send result back to app

In most cases you cannot say how much time it will take, so instead of progress bar think about combination of:

  • hour glass mouse pointer
  • "please wait" in status bar
  • little animation (windmill, rotating gear wheels etc)
Michał Niklas
I came here to post essentially the same thing.If you are waiting on the query, you can't say how much time it is going to take.The best option is a little animation bar on a form that displays overtop of your current display.
Daemonic
A: 

While its true that you cant tell how long the query is going to take, its possible to give your user and idea of the time lapsed/remaining. You use the progress bar control from your VB IDE. You then set its 'max' property to your query recordcount. As you iterate through the records increase the progress bars 'value' property. Here's an example; ('Rs' is an ADODB recordset)

        ProgressBar1.Max = Rs.RecordCount - 1

        For P = 0 To .RecordCount - 1
           ProgressBar1.Value = P

            'some process here
            Rs.MoveNext

        Next P
Jack Njiri