CREATE procedure [dbo].[sel_main_class]
@main_id int
as begin select * from dbo.[main_class] where main_id>@main_id return
end
这是存储过程的定义
et conn=Server.CreateObject("ADODB.Connection")
conn.open "driver={SQL Server};database=wangyan;Server=localhost;uid=sa;pwd="
set rs=Server.CreateObject("ADODB.Recordset")
response.write("haha")
DIM MyComm,MyRst,main_id
main_id=3
Set MyComm = Server.CreateObject("ADODB.Command")
MyComm.ActiveConnection = conn 'MyConStr是数据库连接字串
MyComm.CommandText = "sel_main_class" '指定存储过程名
MyComm.CommandType = 4 '表明这是一个存储过程
MyComm.Prepared = true '要求将SQL命令先行编译
MyComm.Parameters.append MyComm.CreateParameter("@main_id",3,1,4,main_id)
rs.open mycomm,,1,3
response.write(rs.recordcount)
为什么返回值是-1
|