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

timeot error on vbscript

Status
Not open for further replies.

washaw

Programmer
Feb 13, 2008
48
I have wriiten this code and when I executed it, I am getting the following error which I spent hours to figure it out but couldn't can somebody help me

Error source Microsoft OLe db provider fro sql server

error description error code 0
error sourcr= Microsoft OLe db provider fro sql server
error description: Time out expired

error on line 30

timeout expired

Code:
 '**********************************************************************
'  Visual Basic ActiveX Script
'************************************************************************

Function Main()

   Dim stpContinuePkg
   Dim stpExitPkg

   Set pkg = DTSGlobalVariables.Parent

   SET stpContinuePkg = pkg.Steps("DTSStep_DTSExecuteSQLTask_5")
   SET stpExitPkg = pkg.Steps("DTSStep_DTSActiveScriptTask_2")

   Set objCommand = CreateObject("ADODB.Command")
   Set objParam = CreateObject("ADODB.Parameter")
   Set rsYourRecordSet = CreateObject("ADODB.Recordset")

   ' set the connection properties to point to the

   objCommand.ActiveConnection = "provider=SQLOLEDB.1;data source=myServer;database=myDatabase;Integrated Security=SSPI;"

   objCommand.commandtext = "myProc" 
   objCommand.CommandType = 4 
   Set objParm = objCommand.CreateParameter("@SprocInputVar", 3,1,,VBScriptInputVar)          
   objCommand.Parameters.Append objParm
   Set objParm = objCommand.CreateParameter("@SprocOutputVar", 3,2,,VBScriptOutputVar)
   objCommand.Parameters.Append objParm 
   objCommand("@SprocInputVar") = 120

   set rsYourRecordSet = objCommand.Execute

   'to access the output, assign to a variable'

       intSprocValue = objCommand.Parameters("@SprocOutputVar")


   if intSprocValue = 0 then
      stpContinuePkg.DisableStep = True
      stpExitPkg.DisableStep = False
   Else
      stpContinuePkg.DisableStep = False
      stpExitPkg.DisableStep = True
   end if
	Main = DTSTaskExecResult_Success
End Function


any suggestion

Thanks
 
Got it, I just set the CommandTimeout of the connection 300

and this solves it

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top