recordset not returning value from SQL server

Ask a Question related to ASP Database, Design and Development.

  1. #1

    Default recordset not returning value from SQL server

    HI There,

    I am having a little trouble displaying a recordset from SQL Server and I
    was wondering if someone could have a look at my code to see what I have
    missing?
    I can execute the stored procedure successfully in the query analizer, I
    just can't get the records to show on the page.

    Sean - thanks in advance


    !-- stored procedure

    CREATE PROCEDURE GetLargeImages

    @productID int
    AS

    SELECT image1Large, image2Large FROM
    tblProducts WHERE productID=@productID
    GO


    !-- code


    Set adoRec = Server.CreateObject("ADODB.Recordset")
    Set adoCmd = Server.CreateObject("ADODB.Command")
    Set objConn = Server.CreateObject("ADODB.Connection")
    objConn.Open dbConnectionStr

    adoCmd.ActiveConnection = objConn
    adoCmd.CommandType = adCmdStoredProc
    adoCmd.CommandText = "GetLargeImages"

    Set PID = adoCmd.CreateParameter("productID", adInteger, adParamInput,4)
    adoCmd.Parameters.Append PID

    Set adoRec = adoCmd.Execute

    response.write adoRec("image1Large")

    response.End


    sean Guest

  2. Similar Questions and Discussions

    1. Recordset returning inconsistent results
      I am developing a php site using mysql and apache. I have finally managed to get a database connection and am trying now to create some...
    2. Help - stored procedure not returning a recordset
      I have an ASP page that calls a SQL Server stored proc that should return multiple recordsets, but it appears to be returning something else, or it...
    3. Returning ADO recordset over the internet from ASP
      Hi, I remember seeing (a long time ago) an ADO code snippet that would query a local database (Access) and return the result as an ADO recordset...
    4. Vb6 object returning ADO Recordset - Error in .NET
      Hi, My C#, ASP.NET application uses com-interop to call a vb6 method which returns a ADO 2.6 recordset. I can successfully call the COM...
    5. Help with Stored Procedure returning recordset
      Hi, Try to add set nocount on in the beginning of procedure. "Scott McDaniel" <junk@junk.com> wrote in message...
  3. #2

    Default Re: recordset not returning value from SQL server

    What is the data type of image1Large? What string is in dbConnectionStr?

    How about:

    Set conn = CreateObject("ADODB.Connection")
    conn.Open dbConnectionStr
    set rs = conn.execute("EXEC GetLargeImages")
    response.write rs(0)
    rs.close: set rs = nothing
    conn.close: set conn = nothing


    Aaron [SQL Server MVP] Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139