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_numRow s
Set rsImport_cmd = Server.CreateOb ject ("ADODB.Command ")
rsImport_cmd.Ac tiveConnection = MM_aclv4test_ST RING
rsImport_cmd.Co mmandText = "{call dbo.PriceUpdate Import(?,?,?,?, ?)}"
rsImport_cmd.Pr epared = true
rsImport_cmd.Pa rameters.Append
rsImport_cmd.Pa rameters.Append rsImport_cmd.Cr eateParameter(" param1",
200, 1, 255, rsImport__vendo r)
rsImport_cmd.Pa rameters.Append rsImport_cmd.Cr eateParameter(" param2",
200, 1, 255, rsImport__name)
rsImport_cmd.Pa rameters.Append rsImport_cmd.Cr eateParameter(" param3",
200, 1, 255, rsImport__filen ame)
rsImport_cmd.Pa rameters.Append rsImport_cmd.Cr eateParameter(" param4",
200, 1, 255, rsImport__valid from)
rsImport_cmd.Pa rameters.Append rsImport_cmd.Cr eateParameter(" param5",
200, 1, 255, rsImport__user)
Set rsImport = rsImport_cmd.Ex ecute
rsImport_numRow s = 0
%>
There is more code above that sets the variable for each parameter.
I have tried adding this: rsImport_cmd.Cr eateParameter(" @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_numRow s
Set rsImport_cmd = Server.CreateOb ject ("ADODB.Command ")
rsImport_cmd.Ac tiveConnection = MM_aclv4test_ST RING
rsImport_cmd.Co mmandText = "{call dbo.PriceUpdate Import(?,?,?,?, ?)}"
rsImport_cmd.Pr epared = true
rsImport_cmd.Pa rameters.Append
rsImport_cmd.Pa rameters.Append rsImport_cmd.Cr eateParameter(" param1",
200, 1, 255, rsImport__vendo r)
rsImport_cmd.Pa rameters.Append rsImport_cmd.Cr eateParameter(" param2",
200, 1, 255, rsImport__name)
rsImport_cmd.Pa rameters.Append rsImport_cmd.Cr eateParameter(" param3",
200, 1, 255, rsImport__filen ame)
rsImport_cmd.Pa rameters.Append rsImport_cmd.Cr eateParameter(" param4",
200, 1, 255, rsImport__valid from)
rsImport_cmd.Pa rameters.Append rsImport_cmd.Cr eateParameter(" param5",
200, 1, 255, rsImport__user)
Set rsImport = rsImport_cmd.Ex ecute
rsImport_numRow s = 0
%>
There is more code above that sets the variable for each parameter.
I have tried adding this: rsImport_cmd.Cr eateParameter(" @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
Comment