#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2016
    Posts
    16
    Rep Power
    0

    ASP call Stored Procedure & Return Recordset


    Hi

    I am developing a page using Dreamweaver & Classic ASP.

    The page takes 2x URL parameters and uses these to execute a stored procedure (this part all works fine).

    What I cannot get to work is the Stored Procedure to return a recordset.

    Does anyone have an example of a Classic ASP executing a Stored Procedure & Returning a Recordset?
  2. #2
  3. No Profile Picture
    Grumpier old Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jun 2003
    Posts
    14,529
    Rep Power
    4541
    Maybe if you could show a snip of the code that's giving you problems? Back when I worked with asp I tended to use the EXEC statement to call the stored procedure, and never had problems getting the results. With Dreamweaver I have no clue, sorry.
    ======
    Doug G
    ======
    I've never been able to appreciate the sublime arrogance of folks who feel they were put on earth just to save other folks from themselves .." - Donald Hamilton
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2016
    Posts
    16
    Rep Power
    0
    Hi Doug

    This is the code that Dreamweaver is generating

    Code:
    <%
    
    Dim Command1__PBGroup
    Command1__PBGroup = "94"
    if(Request("PBGroup")  <> "") then Command1__PBGroup = Request("PBGroup") 
    
    Dim Command1__PB_Description
    Command1__PB_Description = "2PW IND3A 1USBCP 1MLGSTWIEL WHT%2FWHT"
    if(Request("PBDescription")  <> "") then Command1__PB_Description = Request("PBDescription") 
    
    %>
    <%
    
    set Command1 = Server.CreateObject("ADODB.Command")
    Command1.ActiveConnection = MM_Madics_STRING
    Command1.CommandText = "dbo.Price_Builder_Search_All"
    Command1.Parameters.Append Command1.CreateParameter("@RETURN_VALUE", 3, 4)
    Command1.Parameters.Append Command1.CreateParameter("@PBGroup", 200, 1,2,Command1__PBGroup)
    Command1.Parameters.Append Command1.CreateParameter("@PB_Description", 200, 1,100,Command1__PB_Description)
    Command1.CommandType = 4
    Command1.CommandTimeout = 0
    Command1.Prepared = true
    set Madx = Command1.Execute
    Madx_numRows = 0
    
    %>
    I have tried inserting
    Code:
     <%=(Madx.Fields.Item("Part_Number").Value)%>
    in to the body of the HTML but nothing is displaying.
  6. #4
  7. No Profile Picture
    Grumpier old Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jun 2003
    Posts
    14,529
    Rep Power
    4541
    Hopefully someone familiar with dreamweaver can jump in. I haven't used asp/ado in so many years it looks like a foreign language Nothing obvious jumped out from the code you posted, assuming the syntax for calling a sp from a command object is correct.
    ======
    Doug G
    ======
    I've never been able to appreciate the sublime arrogance of folks who feel they were put on earth just to save other folks from themselves .." - Donald Hamilton

IMN logo majestic logo threadwatch logo seochat tools logo