<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%
Set conn = CreateObject("ADODB.Connection")
strCon = "Provider=SQLNCLI;Password=sa;Persist Security Info=True;User ID=sa;Initial Catalog=Northwind;Data Source=127.0.0.1"
conn.Open strCon
Set cmd = Server.CreateObject("ADODB.Command")
with cmd
.ActiveConnection = conn ’数据库连接字串
.CommandText = "test2" ’指定存储过程名
.CommandType = 4 ’表明这是一个存储过程
.Prepared = true ’要求将SQL命令先行编译
.Parameters.append .CreateParameter("@val1",3,2,4)
.Parameters.append .CreateParameter("@val2",3,2,4)
.Execute
Response.Write(cmd(0) & "_" & cmd(1))’2个output都出来了
Set rs = .Execute
end with
while not rs.eof
response.Write(rs(1) & "<br/>")
rs.movenext
wend
%>
Word教程网 | Excel教程网 | Dreamweaver教程网 | Fireworks教程网 | PPT教程网 | FLASH教程网 | PS教程网 |
HTML教程网 | DIV CSS教程网 | FLASH AS教程网 | ACCESS教程网 | SQL SERVER教程网 | C语言教程网 | JAVASCRIPT教程网 |
ASP教程网 | ASP.NET教程网 | CorelDraw教程网 |