There is a stored procedure in SQL server which takes four values (2 datetime
and 2 varchar
) as input and returns int
value as output. This stored Procedure is working fine in SQL Server. In VBScript code of Classic ASP application, I've made some connections and trying to get the int
output value of Stored procedure and Print on web page. The below is the code..
dim DD 'This variable stores output of the Stored Procedure date_diff
dim CS
CS = "Provider=SQLOLEDB.1; Data Source=BLAHBLAH; InitialCatalog=BLAH; User Id=BLAH; Pwd=BLAH"
dim objConn
dim objRS1
dim StoredProc1
storedProc1 = "exec date_diff ' "& R1("LEAVE_FROM") &" ' , ' "& R1("LEAVE_TO") &" ' ,'"R2("COMPANY_CODE")"','"R2("LOCATION_CODE")"' ,'" & DD &"' output"
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.CommandTimeout = 60
objConn.Open CS
objRS1.CursorLocation = 3
objRS1.CursorType = 3
objRS1.Open StoredProc1, objConn
If not objRS1.EOF Then
response.write DD 'Printing the output of SP here
end if
I am not getting 500 - Internal Server error on the web page. Can you Please guide where am I going wrong..?