Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Status Bar And Timer

Status
Not open for further replies.

renga

Programmer
Jul 17, 2001
5
0
0
CA
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
 
Dear Renga
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top