求助:关于存储过程的问题,高手请进!!!!!

quweiie 2006-02-25 12:01:12
数据库:SQL Server2000
使用的是[pubs]数据库里的titles表创建的Stored Procedure:
CREATE proc MyProc
(
@price smallint,
@out smallint OUTPUT
)
AS
Select @out = count(*) from titles where price < @price
GO
**********************************************************************
xml.asp:
<%
Dim cmd
Dim ln
Dim retCount

Set cmd = Server.CreateObject("ADODB.Command")

With cmd
.ActiveConnection = "Paste your connection string here"
.Commandtext = "MyProc"
.CommandType = adCmdStoredProc
.Parameters.Append .CreateParameter("@price", adSmallInt, adParamInput, 10)
.Parameters("@price") = 22
.Parameters.Append .CreateParameter("@retValue", adSmallInt, adParamOutput, 10)
.Execute ln, , adExecuteNoRecords
retCount = .Parameters("@retValue")
End with

Response.Write retcount

Set cmd = Nothing
%>
请问是哪儿出错了?请指点!!
...全文
61 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
quweiie 2006-02-25
  • 打赏
  • 举报
回复
对了我的数据库是连接上了
<!--#include file="connsql.asp"-->
ActiveConnection = conn
quweiie 2006-02-25
  • 打赏
  • 举报
回复
.Execute ln, , adExecuteNoRecords
这句话,能给我解释一下吗?

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧