Command|command Object | Stored procedure He said that if you return multiple values, such as the recordset and the return value, you must use the Command object ... I'm finally done with it. :)
<%@ Language=vbscript%>
<%
' A section of the test does not use the Command object to invoke the stored procedure's ASP code author: Nature Mail: zhanmr@telekbird.com.cn Home: http://zhanzhen.wayall.com
'----------------------------------------------------------------------------------------------------
' CREATE PROCEDURE TOPNEWSSP
' @intTopRow Int,
' @vcInputMsg Varchar (20),
' @vcReturnMsg Varchar (OUTPUT)
' As
' SET rowcount @intTopRow
' SELECT ID, title, release date, keyword from news WHERE keyword = ' announcement notice ' ORDER by release date Desc,id DESC
' SELECT ID, title, release date, keyword from news WHERE keyword = ' entertainment news ' ORDER by release date Desc,id DESC
' IF @vcInputMsg = ' Male '
' SELECT @vcReturnMsg = ' man '
' ELSE
' SELECT @vcReturnMsg = ' woman '
'----------------------------------------------------------------------------------------------------
Option Explicit
Dim Conn, Rs, Rscount, sqlquery
Set Conn = Server.CreateObject ("ADODB. Connection ")
Conn.Open "ITRD", "sa"
SQLQuery = "DECLARE @returnmsg varchar" & VbCrLf & "EXEC topnewssp 5, ' Male ', @returnmsg OUTPUT" & VbCrLf &am P "Select @returnmsg"
Set Rs = Conn.execute (sqlquery)
Rscount = 1
Do Until Rs are nothing
Rs.movefirst
While not rs.eof
Response.Write Rs (0)
Rs.movenext
Wend
Response.Write "" & Rscount & "RS Object <br>"
Rscount = Rscount + 1
Set Rs = Rs.nextrecordset
Loop
Set Rs = Nothing
Conn.close
Set Conn = Nothing
%>