为什么这个存储过程出错?
为什么这个存储过程出错?小弟刚接触,期待指教。
存储过程:
CREATE PROCEDURE sp_test
@t1 varchar(200),
@t2 varchar(200),
@t3 varchar(200),
@t4 varchar(200)
AS
insert into test(t1, t2, t3, t4) values(@t1, @t2, @t3, @t4)
GO
ASP:
<%
dim cn,cm,sSql
dim t1,t2,t3,t4
t1 = Request.Form("text1")
t2 = Request.Form("text2")
t3 = Request.Form("text3")
t4 = Request.Form("text4")
if t1 <> "" then
set cn = server.CreateObject("adodb.connection")
cn.Open Application("SZCL")
set cm = server.CreateObject("adodb.command")
cm.ActiveConnection = cn
cm.CommandText = "sp_test"
cm.CommandType = 4
cm.Parameters.Append cm.CreateParameter("@t1",adInteger,adParamInput,,t1)
cm.Parameters.Append cm.CreateParameter("@t2",adInteger,adParamInput,,t2)
cm.Parameters.Append cm.CreateParameter("@t3",adInteger,adParamInput,,t3)
cm.Parameters.Append cm.CreateParameter("@t4",adInteger,adParamInput,,t4)
cm.Execute
set cm = nothing
cn.Close()
set cn = nothing
end if
%>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</HEAD>
<BODY>
<FORM action="" method=POST id=form1 name=form1>
<INPUT type="text" id=text1 name=text1>
<INPUT type="text" id=text2 name=text2>
<INPUT type="text" id=text3 name=text3>
<INPUT type="text" id=text4 name=text4>
<INPUT type="submit" value="Submit" id=submit1 name=submit1>
</FORM>
</BODY>
</HTML>
发生错误:
错误类型:
ADODB.Command (0x800A0BB9)
/SZCL/test/Proceduretest.asp, 第 17 行
SQL SERVER数据库
表test,有字段t1,t2,t3,t4都为字符串型