Getting 500 - Internal server error while executing a stored procedure using VB Script in classic asp application
<p>I am supporting an old Classic ASP VBscript application. My bad luck is that I can't even debug the code in my servers. After scripting I need to see the output directly on webpage. The below code is Throwing 500 - Internal server error in webpage. Can you please find where this code has gone wrong. Thanks in advance.
I've followed the below links while building the code</p>

<p><a href="http://www.devx.com/tips/Tip/13399" rel="nofollow">http://www.devx.com/tips/Tip/13399</a></p>

<p><a href="http://STACK_OVERFLOW1">http://stackoverflow.com/questions/36174283/executing-stored-procedure-of-sql-in-vbscript?noredirect=1#comment59989620_36174283</a></p>

<p><a href="http://forums.asp.net/t/1767387.aspx?how%20to%20call%20a%20stored%20procedure%20with%20date%20time%20parameters%20from%20a%20classic%20asp%20page" rel="nofollow">http://forums.asp.net/t/1767387.aspx?how+to+call+a+stored+procedure+with+date+time+parameters+from+a+classic+asp+page</a></p>

<pre><code>'Set Connection String to Database
sConnect = "PROVIDER=SQLOLEDB;DATA SOURCE=SCRBNGADK00XXXX;DATABASE=SMART2XXX;UID=XXXX;PWD=XXXX;"

' Establish connection.
Set oConObj = CreateObject( "ADODB.Connection" )
Set oCmdObj = CreateObject("ADODB.Command")
Set Rs1 = CreateObject( "ADODB.Recordset" )
oConObj.ConnectionString = sConnect
oConObj.Open

Set oCmdObj.ActiveConnection = oConObj
oCmdObj.commandtype=adCmdStoredProc
oCmdObj.CommandText = "date_diff"

Set objParm = oCmdObj.CreateParameter("@from", adDBTimeStamp, adParamInput,, R1("LEAVE_FROM"))
oCmdObj.Parameters.Append objParm
Set objParm = oCmdObj.CreateParameter("@To", adDBTimeStamp, adParamInput,,  R1("LEAVE_TO"))
oCmdObj.Parameters.Append objParm
Set objParm = oCmdObj.CreateParameter("@companycode", adVarChar, adParamInput,200, R2("COMPANY_CODE"))
oCmdObj.Parameters.Append objParm  
Set objParm = oCmdObj.CreateParameter("@locationcode", adVarChar, adParamInput,200, R2("LOCATION_CODE"))
oCmdObj.Parameters.Append objParm
Set objParm = oCmdObj.CreateParameter("@hol", adInteger, adParamOutput)
oCmdObj.Parameters.Append objParm
set Rs1 = oCmdObj.Execute
OutPut = oCmdObj.Parameters("@hol")


If Not IsNull(OutPut) Then
wscript.echo "Result :" &amp; OutPut
End If

Set Rs1 = Nothing
Set oConObj = Nothing
Set oCmdObj = Nothing
</code></pre>