Autor Tema: Show a continuous progress bar when do sql interrogation?  (Leído 2852 veces)

0 Usuarios y 1 Visitante están viendo este tema.

cliv

  • Kilobyte
  • **
  • Mensajes: 69
  • Reputación: +1/-2
    • Ver Perfil
Show a continuous progress bar when do sql interrogation?
« en: Marzo 02, 2011, 01:22:16 pm »
I made a small ERP for my firm ...and i have a problem. I have a lot of sql interrogation (client conected to a server in LAN) ..and this takes very long time..
It is possible to display a continuous progress bar when i do sql interrogation because it takes a very long time to wait for user.
I think i can use multi-threading but I do not know how.
Can someone help...

Here is a screenshot for my ERP:

« última modificación: Marzo 02, 2011, 01:28:32 pm por cliv »

el_trocha

  • Kilobyte
  • **
  • Mensajes: 62
  • Reputación: +1/-2
    • Ver Perfil
Re:Show a continuous progress bar when do sql interrogation?
« Respuesta #1 en: Marzo 03, 2011, 08:04:21 pm »
What I would do the following:

i made of  pogressbar from 0 to 60. As if the bar was the account of a minute.

Namely: Ownership:

Property: Min. 0
Property: Max. 60

Would create a timer that every second will add a 1 to the progress bar.

Event. : Progressbar.Value = 1

When the bar reaches the end of 60 seconds then would make the Value property value back to 0 and retelling.

It would be interesting that every time the timer is turned on, ask if the connection has been established.

If the connection has been established then close the Timer.

If the connection is not established entonecwss still counting.

Hope that helps.

A greeting.

cliv

  • Kilobyte
  • **
  • Mensajes: 69
  • Reputación: +1/-2
    • Ver Perfil
Re:Show a continuous progress bar when do sql interrogation?
« Respuesta #2 en: Marzo 05, 2011, 09:54:18 am »
Timer stop working when you create a long SQL Query...
I thing that only possibility is to using multithreadind...

el_trocha

  • Kilobyte
  • **
  • Mensajes: 62
  • Reputación: +1/-2
    • Ver Perfil
Re:Show a continuous progress bar when do sql interrogation?
« Respuesta #3 en: Marzo 05, 2011, 01:34:42 pm »
I imagine that the query shown in some control ....

 Have you tried to activate a timer just after making the query and stop right at the moment in which the control data received recordset activated.

 That would be another option.
Código: (vb) [Seleccionar]
private sub command1_click ()

sql = "SELECT..... "

set rst = conexion.ejecute(sql)

timer1.enable = true
timer1_timer

end sub

private sub timer1_timer()

  If rst.EOF = True Then
       
       progressbar.value = 1       

 else

       timer.enable = false

  end if

end sub
« última modificación: Marzo 05, 2011, 02:31:22 pm por xkiz ™ »