Hi!.. I have a question for you guys... but first the data.. I'm working with SQL Server DB, under Windows 2K. The DB has around 5K of records
I have this SQL statement:
VB Code:
DoEvents sql = "SELECT BeOrdenTrabajo.Orden, BeOrdenTrabajo.ID, Rack, (Fecha3TFIn - FechaWO) as TotalTime, BeOrdenTrabajo.Carga, Descarga, " _ & " (SELECT TOP 1 BeModelos.Modelo FROM BeRequisicion,BeModelos WHERE BeOrdenTrabajo.Orden " _ & " = BeRequisicion.orden AND BeRequisicion.Modelo = BeModelos.Modelo GROUP BY BeModelos.Modelo) as MyModel, " _ & " (SELECT TOP 1 BeModelos.TiempoBI FROM BeRequisicion,BeModelos WHERE BeOrdenTrabajo.Orden " _ & " = BeRequisicion.orden AND BeRequisicion.Modelo = BeModelos.Modelo GROUP BY BeModelos.TiempoBI) as MyBI, " _ & " (DateAdd(Hour,-(SELECT TOP 1 BeModelos.TiempoBI FROM BeRequisicion,BeModelos WHERE BeOrdenTrabajo.Orden " _ & " = BeRequisicion.orden AND BeRequisicion.Modelo = BeModelos.Modelo GROUP BY BeModelos.TiempoBI)," _ & "(Fecha3TFIn - FechaWO))) as Dif FROM BeOrdenTrabajo WHERE Proceso > 3 ORDER BY Dif DESC" RSBIData.CursorLocation = adUseClient RSBIData.Open sql, frmDisplay.eabscn, adOpenStatic, adLockOptimistic
While doing this process I'm trying to show a blinking label to indicates that the program is doing something (For that I use a timer) so I use a DoEvents just before the SQL.
What I expected was to have a runnign process, slow process, and a blinking label telling that the program is working even if it looks like is freezed. But what I have is the running process, slow of course, and a freezed label so the program looks like dead... then my questions are:...
a) Is there a way to improve the speed of the SQL statement (Right now takes around 15-20 seconds to complete)
b) What can I do to show the make the label "blink" while processing the SQL




Reply With Quote