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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Progress or status bar show when a store procdure gets executed 1

Status
Not open for further replies.

traveller4

Programmer
Sep 18, 2002
62
CA
I am trying to have a progress or status bar show when a store procdure gets executed through a click event. This stored procedure runs for about two minutes. It would be nice if the user could see some sign of life.

Any ideas would be greatly appreciated

Thanks in advance

Micheal
 
Which application ? How is the stored procedure executed ?
Can you post some snippets of your code ?

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
Sorry PH for the lack of info

This is a click event on a form in a Microsoft Access ADP

As for the code I am on the road right now and can't get to my dev server right now but will post later.

Thanks for your prompt response.

Micheal
 
If using DAO take a look at the StillExecuting property of a RecordSet opened with dbRunAsync option.

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
PHV

I am using ADO

Here is my code

Private Sub cmdMoveTimeslips_Click()
On Error GoTo Err_cmdMoveTimeslips_Click

Dim cmd As ADODB.Command
Dim strAnnCor As ADODB.Parameter
Dim strFiscal As ADODB.Parameter
Dim strMonStart As ADODB.Parameter
Dim strMonEnd As ADODB.Parameter


Set cmd = New ADODB.Command
cmd.CommandTimeout = 300
cmd.ActiveConnection = CurrentProject.Connection
cmd.CommandType = adCmdStoredProc
cmd.CommandText = "UDF_APD_Move_LF_Slips_SLA_Dyn"

Set strAnnCor = cmd.CreateParameter("@strAnnCor", adVarChar, adParamInput, 20)
Set strFiscal = cmd.CreateParameter("@strFiscal", adVarChar, adParamInput, 20)
Set strMonStart = cmd.CreateParameter("@strMonStart", adVarChar, adParamInput, 20)
Set strMonEnd = cmd.CreateParameter("@strMonEnd", adVarChar, adParamInput, 20)



cmd.Parameters.Append strAnnCor
strAnnCor.Value = cboAnnCore.Value

cmd.Parameters.Append strFiscal
strFiscal.Value = g_strFiscalYear

cmd.Parameters.Append strMonStart
strMonStart.Value = cboStartMonth.Value

cmd.Parameters.Append strMonEnd
strMonEnd.Value = cboEndMonth.Value

cmd.Execute

DoCmd.RunSQL "EXEC UDF_Upd_SLA_Track", -1


Exit_cmdMoveTimeslips_Click:
Exit Sub
 
You can try to Execute your command with the adAsyncExecute option and then looping while cmd.State = adStateExecuting (or > adStateOpen) doing some DoEvents and giving some sign of life.

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
Ph


I used your idea with the adStateExecuting command and the Progress bar 6.0 and it works slick. Have a star on me

Thanks again

--Micheal
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top