Status Bar And Timer
Status Bar And Timer
(OP)
Hi
I am using VB and MTS with Oracle. Some time in my application I used to run a complex queries. At that time I wold like to display a status bar with a message. But Timer doesn't work. Once I call MTS component from my code, control comes back after the excection is completed. I put Timer in my form. It doesn't work. Control never goes to timer while MTS component is getting excecuted.
If anybody knows a way,Please respond.
Renga
I am using VB and MTS with Oracle. Some time in my application I used to run a complex queries. At that time I wold like to display a status bar with a message. But Timer doesn't work. Once I call MTS component from my code, control comes back after the excection is completed. I put Timer in my form. It doesn't work. Control never goes to timer while MTS component is getting excecuted.
If anybody knows a way,Please respond.
Renga
RE: Status Bar And Timer
there could be several solution to you problem but what i do is to make disconnected recordset during intiiliaze event of form so user wont be able to catch there is some processing going on behind,user can wait for time before he actullay sees records at form,now if u want to refresh the recordset say at some command button click then there could be solution go for "DATABASE RECORDSET PAGING" technique if ur recordset retuning very huge amount of data,in this way you can ask for a page of time to be viewed at a time..
i am posting a code snippets but you have to use "PAGING" at DATABSE level using "Storder Procedure" or whih method u r using then this code it will work for you...
Regards
Nouman
Senior Software Engineer
Screen.MousePointer = vbHourglass
prgCuttingMain.Min = 0
prgCuttingMain.Max = 220
prgCuttingMain.Visible = True
intStatusBar = 10
prgCuttingMain.Value = intStatusBar
intStatusBar = 20
prgCuttingMain.Value = intStatusBar
Set mobjRsCuttingItems = mobjCutting.GetCuttingItems 'call to MTS
If Not mobjRsCuttingItems.EOF Then
mobjRsCuttingItems.MoveFirst
For intI = 0 To mobjRsCuttingItems.RecordCount - 1
mobjRsCuttingItems.Fields(STR_FLD_CUT_ITEMCOUNT) = intI + 1
If intStatusBar < 200 Then
intStatusBar = intStatusBar + 5 * intI
End If
prgCuttingMain.Value = intStatusBar
mobjRsCuttingItems.MoveNext
Next intI
End If
Set grdCutting.DataSource = mobjRsCuttingItems
frmCuttingDetails.CuttingDetailRecordSet = mobjRsCuttingItems
intStatusBar = intStatusBar + 5
prgCuttingMain.Value = intStatusBar
intStatusBar = intStatusBar + 5
prgCuttingMain.Value = intStatusBar
Call SetCuttingGrid
intStatusBar = intStatusBar + 5
prgCuttingMain.Value = intStatusBar
Screen.MousePointer = vbDefault
prgCuttingMain.Value = 220
prgCuttingMain.Visible = False