ASP SQL存储过程问题

来源:百度知道 编辑:UC知道 时间:2024/05/16 17:09:37
刚开始学SQL存储过程,请问下面的ASP语句怎么写存储过程?
set rs=server.CreateObject("adodb.recordset")
rs.open "select user_pass from [our_user] where user_name='"&user_name&"' and user_pass='"&old_user_pass&"'",conn,1,3
if not rs.eof and not rs.bof then
rs("user_pass")=user_pass
rs.update
end if
rs.close
set rs=nothing
rs("user_pass")=user_pass
rs.update

这个没写到嘛

CREATE PROCEDURE 存储过程名 @USER_NAME CHAR(10),@old_USER_PASS CHAR(20)
AS
SELECT user_pass from our_user
where user_name=@user_name and user_pass=@old_user_pass
GO

再将ASP代码改成 --基于SQL SERVER
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open("Provider=SQLOLEDB.1;User ID=SA;Password=;Initial Catalog=DB_name;Data Source=Server_name")

set rs=conn.execute("存储过程名")