Professional Web Applications Themes

Pulling PRINT results from a stored procedure - ASP Database

Hi, I'd like to pull the results of a sproc within ASP as a text field, e.g. PRINT statements, "### Rows Affected", etc. How would I go about doing that? Regards, Scott...

  1. #1

    Default Pulling PRINT results from a stored procedure

    Hi,

    I'd like to pull the results of a sproc within ASP as a text field, e.g.
    PRINT statements, "### Rows Affected", etc. How would I go about doing
    that?

    Regards,
    Scott
    Scott McNair Guest

  2. #2

    Default Re: Pulling PRINT results from a stored procedure

    Change the stored procedure to return resultsets instead of print
    statements, set ROWCOUNT to putput variables or resultsets, etc. ADO can
    see row(s) affected messages but can't do anything with them, and I don't
    believe it can even see the PRINT statements.

    --
    [url]http://www.aspfaq.com/[/url]
    (Reverse address to reply.)






    "Scott McNair" <scott.mcnairsfmco.takethispartout.com> wrote in message
    news:Xns952C59546A714sfmco207.46.248.16...
    > Hi,
    >
    > I'd like to pull the results of a sproc within ASP as a text field, e.g.
    > PRINT statements, "### Rows Affected", etc. How would I go about doing
    > that?
    >
    > Regards,
    > Scott

    Aaron [SQL Server MVP] Guest

  3. #3

    Default Re: Pulling PRINT results from a stored procedure

    "Aaron [SQL Server MVP]" <ten.xocdnartreb.noraa> wrote in
    news:OgeABHmbEHA.1656TK2MSFTNGP09.phx.gbl:
    > Change the stored procedure to return resultsets instead of print
    > statements, set ROWCOUNT to putput variables or resultsets, etc.
    > ADO can see row(s) affected messages but can't do anything with them,
    > and I don't believe it can even see the PRINT statements.
    Thanks for the response, Aaron. I actually was being obscure in my
    request, my primary concern was being able to pass data to an ASP page
    without having to rely on a table, through the command object. As
    ironically always seems to be the case, I found the answer within 5
    minutes of posting on the newsgroup, by doing some creative googling.

    As an aside, it's sort of frustrating to see what kind of hoops you have
    to jump through in order to pull a simple result off of a sproc. This
    seems a rather roundabout way just to get a simple boolean "yes/no"
    result, don't you think?

    Function IsAdmin(UserName)
    Dim cmd, param
    dim conServer
    Set conServer = server.CreateObject("ADODB.Connection")
    Set cmd=server.CreateObject("ADODB.Command")
    conServer.ConnectionTimeout = 120
    conServer.CommandTimeout = 120
    conServer.Provider = "SQLOLEDB"
    conServer.ConnectionString = SQLSERVER
    conServer.Open
    With cmd
    .CommandType=adcmdstoredproc
    .CommandText = "ProductDevelopment.dbo.pr_IsAdmin"
    set .ActiveConnection=conServer
    .Parameters.Append .CreateParameter ("loginname",
    advarchar, adParamInput, 50, UserName)
    .Parameters.Append .CreateParameter ("IsAdmin", adBoolean,
    adParamOutput)
    .execute ,,adexecutenorecords
    IsAdmin = .Parameters("IsAdmin")
    end with
    End Function
    Scott McNair Guest

Similar Threads

  1. Stored Procedure
    By Aaron Bertrand - MVP in forum ASP.NET
    Replies: 13
    Last Post: July 5th, 05:43 AM
  2. drop down menu not pulling results
    By quiero mas in forum Coldfusion Database Access
    Replies: 6
    Last Post: December 23rd, 05:25 PM
  3. Pulling the Verity Collection Name from Results
    By Flyguy1996 in forum Coldfusion - Getting Started
    Replies: 0
    Last Post: August 15th, 07:51 PM
  4. stored procedure help
    By Maria in forum Dreamweaver AppDev
    Replies: 3
    Last Post: April 20th, 06:55 PM
  5. need help on a stored procedure
    By Helixpoint in forum Microsoft SQL / MS SQL Server
    Replies: 0
    Last Post: July 8th, 01:26 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not 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