ASP如何调用存储过程--看了很多贴,觉得都不是自己需要的,谢谢

sunhonglei2004 2009-04-08 01:46:21
存储过程如下,带一个参数:

CREATE PROCEDURE sp_ceshi
@id int
AS
begin
select kehu_user from tb_lcd where id=@id
end
GO

数据库连接文件 conn.asp

<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%dim conn,db
db = "Driver={SQL Server};server=(local);uid=sa;pwd=;database=student;"
Set conn = Server.Createobject("ADODB.Connection")
conn.open db
%>

调用页面代码 ceshi.asp '这个不会写

<%
dim id
id=request.querystring("id") '取得用GET方法提交的参数
'接下来如何调用sp_ceshi这个存储过程,谢谢
%>
...全文
91 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
lzp4881 2009-04-10
  • 打赏
  • 举报
回复
http://hi.baidu.com/lz0830/blog/item/ac409b3e1874363b70cf6cb8.html
wanghongcc 2009-04-10
  • 打赏
  • 举报
回复
set rs=server.CreateObject("adodb.recordset")
rs.open "exec sp_ceshi" &id,conn
ly8199 2009-04-09
  • 打赏
  • 举报
回复
set rs=conn.execute("exec sp_ceshi "&id)
chang1216 2009-04-08
  • 打赏
  • 举报
回复
sql="sp_ceshi "&request.querystring("id")
set rs=server.createobject("adodb.recordset")
rs.open sql, conn,3,1
这样就可以
sunhonglei2004 2009-04-08
  • 打赏
  • 举报
回复
大侠,链接看了,没有看明白,

28,390

社区成员

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

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