D
Dooza
I have a stored procedure that takes a number of inputs, does a bulk
insert, and then outputs a recordset. When I run the stored procedure in
Server Management Studio I also get a return value from the stored
procedure which is an INT.
I want to access this return value on my ASP/VBScript page, but do not
know how to access it.
Here is my code so far:
<%
Dim rsImport
Dim rsImport_cmd
Dim rsImport_numRows
Set rsImport_cmd = Server.CreateObject ("ADODB.Command")
rsImport_cmd.ActiveConnection = MM_aclv4test_STRING
rsImport_cmd.CommandText = "{call dbo.PriceUpdateImport(?,?,?,?,?)}"
rsImport_cmd.Prepared = true
rsImport_cmd.Parameters.Append
rsImport_cmd.Parameters.Append rsImport_cmd.CreateParameter("param1",
200, 1, 255, rsImport__vendor)
rsImport_cmd.Parameters.Append rsImport_cmd.CreateParameter("param2",
200, 1, 255, rsImport__name)
rsImport_cmd.Parameters.Append rsImport_cmd.CreateParameter("param3",
200, 1, 255, rsImport__filename)
rsImport_cmd.Parameters.Append rsImport_cmd.CreateParameter("param4",
200, 1, 255, rsImport__validfrom)
rsImport_cmd.Parameters.Append rsImport_cmd.CreateParameter("param5",
200, 1, 255, rsImport__user)
Set rsImport = rsImport_cmd.Execute
rsImport_numRows = 0
%>
There is more code above that sets the variable for each parameter.
I have tried adding this: rsImport_cmd.CreateParameter("@RETURN_VALUE",
3, 4) but I got this error:
Microsoft OLE DB Provider for ODBC Drivers error '80040e21'
Multiple-step OLE DB operation generated errors. Check each OLE DB
status value, if available. No work was done.
My stored procedure doesn't declare an output return value, which may be
the problem, but when I execute the stored procedure in server
management studio I am given a return value.
Any ideas or pointers?
Cheers,
Steve
insert, and then outputs a recordset. When I run the stored procedure in
Server Management Studio I also get a return value from the stored
procedure which is an INT.
I want to access this return value on my ASP/VBScript page, but do not
know how to access it.
Here is my code so far:
<%
Dim rsImport
Dim rsImport_cmd
Dim rsImport_numRows
Set rsImport_cmd = Server.CreateObject ("ADODB.Command")
rsImport_cmd.ActiveConnection = MM_aclv4test_STRING
rsImport_cmd.CommandText = "{call dbo.PriceUpdateImport(?,?,?,?,?)}"
rsImport_cmd.Prepared = true
rsImport_cmd.Parameters.Append
rsImport_cmd.Parameters.Append rsImport_cmd.CreateParameter("param1",
200, 1, 255, rsImport__vendor)
rsImport_cmd.Parameters.Append rsImport_cmd.CreateParameter("param2",
200, 1, 255, rsImport__name)
rsImport_cmd.Parameters.Append rsImport_cmd.CreateParameter("param3",
200, 1, 255, rsImport__filename)
rsImport_cmd.Parameters.Append rsImport_cmd.CreateParameter("param4",
200, 1, 255, rsImport__validfrom)
rsImport_cmd.Parameters.Append rsImport_cmd.CreateParameter("param5",
200, 1, 255, rsImport__user)
Set rsImport = rsImport_cmd.Execute
rsImport_numRows = 0
%>
There is more code above that sets the variable for each parameter.
I have tried adding this: rsImport_cmd.CreateParameter("@RETURN_VALUE",
3, 4) but I got this error:
Microsoft OLE DB Provider for ODBC Drivers error '80040e21'
Multiple-step OLE DB operation generated errors. Check each OLE DB
status value, if available. No work was done.
My stored procedure doesn't declare an output return value, which may be
the problem, but when I execute the stored procedure in server
management studio I am given a return value.
Any ideas or pointers?
Cheers,
Steve