Visual Basic Foro
Programación => Visual Basic 6 => Mensaje iniciado por: cliv 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:
(http://i53.tinypic.com/m8ziaq.jpg)
-
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.
-
Timer stop working when you create a long SQL Query...
I thing that only possibility is to using multithreadind...
-
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.
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