发信人: yahao@GZ()
整理人: qcrsoft(2002-05-21 18:13:17), 站内信件
|
标 题: Re: 请问斑竹和大虾,执行一带参数的存储过程后,如何返回它的RecordSet? 发信站: 网易虚拟社区 (Thu Jul 27 16:05:28 2000), 转信
【 在 aven (Aven) 的大作中提到: 】
: 在VB里面执行一带参数的存储过程后,如何返回它的RecordSet?
存贮过程代码:
/****** Object: Stored Procedure dbo.sp_CheckMember ******/
CREATE PROCEDURE sp_CheckMember @username varchar(20),@userpass varc har(14) as
select u_ID ,u_Pass,u_NickName from member where u_ID=@username
and u_Pass=@userpass
ASP代码:
Set adoConn = Server.CreateObject("ADODB.Connection")
Set adoRs = Server.CreateObject("ADODB.Recordset")
Set adoCmd = Server.CreateObject("ADODB.Command")
adoConn.Open "bbs","sa",""
Set adoCmd.ActiveConnection = adoConn
adoCmd.CommandType = 4 'Stored Procedure
adoCmd.CommandText = "sp_CheckMember"
adoCmd.Parameters.Append adoCmd.CreateParameter("username",200,1,20, UserID)
adoCmd.Parameters.Append adoCmd.CreateParameter("userpass",200,1,14, UserPass)
Set adoRs = adoCmd.Execute
UserName = adoRs.Fields("u_NickName").Value
...
-- 【 http://www.aspcn.com 】-〉ASP中华网:中国的ActiveX组件搜索地、ASP文章、教程 【 http://yahao.163.net 】-〉亚豪驿站™:我的个人主页,内容不多,个人兴趣爱好而已 【 --- [email protected] ---】-〉我的信箱,别扔炸弹哦!
※ 来源:.月光软件站 http://www.moon-soft.com.[FROM: 61.131.15.97]
|
|