I have a stored procedure which returns 2 tables and 1 output value. I want
the first table to be assigned to rs1 and the second to rs2. However when I
run this, I get the following error as I begin to refer to the rs2 recordset
(Do while not rs2.eof). I have even used 2 ".execute" statements in the code
below, but the code assigns the first recordset twice.
Microsoft VBScript runtime error '800a01a8'
Object required: 'rs2'
/output.asp, line 166
How can I assign the two tables to the appropriate recordsets? Also, I need
the .MoveFirst method support, and if possible, the .Filter method.
The code for calling the Stored Procedure is below
' --------------------------------------------------------------------------------
Set rs1 = Server.CreateOb ject("ADODB.Rec ordset")
Set rs2 = Server.CreateOb ject("ADODB.Rec ordset")
Set adocmd = Server.CreateOb ject("ADODB.Com mand")
adocmd.CommandT imeout = 120
adocmd.ActiveCo nnection = conn
adocmd.CommandT ype = adCmdStoredProc
adocmd.CommandT ext = "dbo.spr_MyProc edure"
With adocmd
set param = .createparamete r("@searchstrin g", adVarchar, adParamInput, 40,
guid)
.parameters.app end param
set param = .createparamete r("@numvalues ", adInteger, adParamOutput)
.parameters.app end param
On Error Resume Next
errorstring = ""
errornumber = 0
set rs1 = .execute
set rs2 = rs1.NextRecords et
'-- check the return value
If Err.Number <0 Then
errorstring = "<p>Error Number " & Err.Number & "<br>" & "The Error Code
was: " & Err.Description & "</p>"
errornumber = Err.Number
Response.Write( errorstring)
Response.Redire ct(HomePath & "/error.asp?eid=u nknown")
End If
numvalues = .Parameters("@n umvalues").Valu e
End With
On Error GoTo 0
set adocmd = nothing
' --------------------------------------------------------------------------------
Thank You,
Julian 1 11319
stjulian wrote:
I have a stored procedure which returns 2 tables and 1 output value.
I want
the first table to be assigned to rs1 and the second to rs2. However
when I
run this, I get the following error as I begin to refer to the rs2
recordset (Do while not rs2.eof). I have even used 2 ".execute"
statements in the code below, but the code assigns the first
recordset twice.
Microsoft VBScript runtime error '800a01a8'
Object required: 'rs2'
/output.asp, line 166
How can I assign the two tables to the appropriate recordsets? Also,
I need
the .MoveFirst method support, and if possible, the .Filter method.
The code for calling the Stored Procedure is below
'
----------------------------------------------------------------------
----------
Set rs1 = Server.CreateOb ject("ADODB.Rec ordset")
Set rs2 = Server.CreateOb ject("ADODB.Rec ordset")
Set adocmd = Server.CreateOb ject("ADODB.Com mand")
adocmd.CommandT imeout = 120
adocmd.ActiveCo nnection = conn
adocmd.CommandT ype = adCmdStoredProc
adocmd.CommandT ext = "dbo.spr_MyProc edure"
With adocmd
set param = .createparamete r("@searchstrin g", adVarchar,
adParamInput, 40, guid)
.parameters.app end param
set param = .createparamete r("@numvalues ", adInteger, adParamOutput)
.parameters.app end param
On Error Resume Next
errorstring = ""
errornumber = 0
set rs1 = .execute
set rs2 = rs1.NextRecords et
Firstly, in order to avoid extra resultsets containing "x rows effected"
messages, make sure you include the line "SET NOCOUNT ON" in the body of
the stored procedure.
Next, if you need bookmark support, you need to set the recordset's
cursortype to either static or dynamic and use Open rather than Execute
to open them:
rs1.CursorType = adopenStatic
rs1.Open adocmd
Set rs2=rs1.Nextrec ordset
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: randy.p.ho |
last post by:
Using JDBC, is there a way to call a stored procedure with multiple
return values? Thanks.
|
by: Adam Knight |
last post by:
Hi all,
I am wanting to get a stored procedure return value via ADO.NET..
Code: Below:
|
by: Godzilla |
last post by:
Dear all,
I have a challenge in hand and am not too sure how to accomplish this
using stored procedure. I have a table containing about 3 fields, but I
need to reorder/renumber a field value every time there is an insert or
delete on the table. Below is the table structure:
tableID customerID pageID
===== ======== ======
0 1 0
|
by: hariharanmca |
last post by:
How to Shift or Copy Data from Sqlserver to MS Access using Stored procedure
I am passing the clint MS Access file path in that i want to insert or update data in that MS Access file using Store Procedure.
Thank you
|
by: Srireddy |
last post by:
Hi all,
I am trying to read an xml using stored procedure and upload it in to the DB. I am using DB2 v8.0. can anyone help me complete my assignment... Thanks in advance..
| |
by: vertigo262 |
last post by:
Is it possible to use to select statements in a stored procedure?
I am building a movie rating system, what I am doing is creating a table with movies and individual user ratings.
The code needs to get a count of the ratings, then the sum of them to get the percentage.
I am getting a error
Exception Details: System.IndexOutOfRangeException: columncount
|
by: madhuparimi |
last post by:
I am working on jasper reports.First i want to know how to generate a ireport using stored procedure.
Can u please help me out and tell me how to generate an ireport using stored procedure
|
by: qwedster |
last post by:
Folk!
How to programattically check if null value exists in database table (using stored procedure)?
I know it's possble in the Query Analyzer (see last SQL query batch statements)?
But how can I pass null value as parameter to the database stored procedure programattically using C#?
Although I can check for empty column (the following code passes string.Empty as parameter but how to pass null value?), I cannot check for null value...
|
by: hemantc87 |
last post by:
i have created this function with a parameter offset and i want to access the database using stored procedure but the code and stored procedure i have written below is not working...what is the right way to do it??
public bool isoffsetexist(int offset)
{
conn.Open();
SqlCommand cmd = new SqlCommand();
cmd.Connection = conn;
cmd.CommandType = CommandType.StoredProcedure;
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
| |
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |