我的存储过程是:
CREATE PROCEDURE updatecompany
@engname varchar(50),
@chiname varchar(50),
@country varchar(50),
@website varchar(50),
@enginstruction varchar(201),
@chiinstruction varchar(201),
@id1 int
AS
update detail set eng=@engname ,company=@chiname,country=@country
,website=@website,engdet=@enginstruction,instructions=@chiinstruction where id = @id1
GO
这是我后台的代码:
set myComm = Server.CreateObject("ADODB.COMMAND")
dim t1,t2,t3,t4,t5,t6
t1=request.Form("tx1")
t2=request.Form("tx2")
t3=request.Form("tx3")
t4=request.Form("tx4")
t5=request.Form("tx5")
t6=request.Form("tx6")
with myComm
.ActiveConnection = myconn
.CommandText ="updatecompany"
.CommandType =adcmdstoredproc
'创建存储过程参数
'获取存储过程的返回值,只需要设定CreateParameter的第3个参数为adParamReturnValue就可以了
set mypar = .CreateParameter("@id1",adInteger, adParamInput) '用户名
.Parameters.Append myPar
.Parameters("@id1")=uu
set myPar1=.CreateParameter("@engname",adVarChar,adParamInput,50) '用户名
.Parameters.Append myPar1
.Parameters("@engname")=t1
set myPar2=.CreateParameter("@chiname",adVarChar,adParamInput,50) '密码
.Parameters.Append myPar2
.Parameters("@chiname")=t2
set myPar3=.CreateParameter("@country",adVarChar,adParamInput,50) '姓名
.Parameters.Append myPar3
.Parameters("@country")=t3
set myPar4=.CreateParameter("@website",adVarChar,adParamInput,50) '生日
.Parameters.Append myPar4
.Parameters("@website")=t4
set myPar5=.CreateParameter("@enginstruction",adlongvarchar,adParamInput,201)
.Parameters.Append myPar5
.Parameters("@enginstruction")=t5
set myPar6=.CreateParameter("@chiinstruction",adlongvarchar,adParamInput,201)
.Parameters.Append myPar6
.Parameters("@chiinstruction")=t6
.Execute()
end with
运行时它提示:
Microsoft OLE DB Provider for SQL Server 错误 '80040e07'
操作数类型冲突: text 与 int 不兼容
/member/goupdate.asp,行70
@id1用的是session(id1)的值,而chiinstruction和enginstruction的sql里面用的是vanchar,它实际上是备注信息,请大家帮我看看 ,谢谢