Results 1 to 5 of 5
  1. #1
    Join Date
    Jun 2006
    Posts
    66

    Unanswered: 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

  2. #2
    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.

  3. #3
    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

  4. #4
    Join Date
    Apr 2007
    Posts
    29

  5. #5
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •