If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > returning values in asp from sql stored procedure

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-13-07, 05:13
esthera esthera is offline
Registered User
 
Join Date: Jun 2006
Posts: 66
returning values in asp from sql stored procedure

I have done this many times and it worked so i must not be seeing the error

below is my code

it tells me item cannot be found in collection...

when I execute the sp in query alalyzer I am returned the regid and price

does anyone see what i'm doing wrong

Code:
sql="exec spaddconfreg @name="& sname & ",@nameoforganization=" & nameoforganization & ",@stpob=" & stpob & ",@city=" & city & ",@zip=" & zip & ",@emailaddress=" & emailaddress & ",@phonenumber=" & phonenumber & ",@mobilephonenumber=" & mobilephonenumber & ",@dietaryrestrictions=" &dietaryrestrictions & ",@sessions=" & sessions & ",@meal=" & tosql(request("meal"),"text") & ",@ndays=" & numdays
response.write sql
Set objRs = Server.CreateObject("ADODB.Recordset")
objRs.Open sql, objConn
regid=objrs("regid")
price=objrs("price")
objrs.close
Reply With Quote
  #2 (permalink)  
Old 05-14-07, 03:06
khurram007 khurram007 is offline
Registered User
 
Join Date: Apr 2007
Posts: 29
Post here both queries.

First what are you writing in MSSQL Query Analyzer when getting results.
Second - what is written on the page as a result of respons.write sql.


Khurram.
Reply With Quote
  #3 (permalink)  
Old 05-14-07, 03:11
esthera esthera is offline
Registered User
 
Join Date: Jun 2006
Posts: 66
i found the issue

i needed to add set no count on in the stored procedure as nothing was being returned
Reply With Quote
  #4 (permalink)  
Old 05-14-07, 04:11
khurram007 khurram007 is offline
Registered User
 
Join Date: Apr 2007
Posts: 29
Glad it is working.

Khurram.
Reply With Quote
  #5 (permalink)  
Old 05-17-07, 22:11
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
Quote:
Originally Posted by esthera
i found the issue

i needed to add set no count on in the stored procedure as nothing was being returned
Actually that is not what was happening. You were getting multiple recordsets and the first one was empty.

You could have used objrs.NextRecordSet() and got the next set of results.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On