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
http://www.devx.com/tips/Tip/13399
'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 :" & OutPut
End If
Set Rs1 = Nothing
Set oConObj = Nothing
Set oCmdObj = Nothing