[急问][送分]关于包含ntext类型参数的存储过程的调用(附源码)
wywf 2004-02-08 11:46:33 存储过程的原码如下
CREATE PROCEDURE usr_article_edit
@a_id int,@c_id int,@t_id int,@u_id int,
@caption char(40),@content ntext,@cost int
AS
declare @t_t_id int,@t_c_id int
select @t_t_id=teacher_typeid,@t_c_id=catalog_id
from teacher
where teacher_id=@u_id
if @t_t_id=5 and not exists(select *
from article
where article_id=@a_id and teacher_id=@u_id and catalog_id=@t_c_id)
begin
return 0
end
if @t_t_id=4 and not exists(select *
from article
where article_id=@a_id and catalog_id=@t_c_id)
begin
return 0
end
if not exists(select article_id
from article
where article_id=@a_id)
begin
return 0
end
update article
set article.caption=@caption,article.cost=@cost,article.content=@content,article.catalog_id=@c_id,article.type_id=@t_id
where article.article_id=@a_id
return @@rowcount
GO
asp调用部分代码
cmdquery.CommandType=adCmdStoredProc
cmdquery.CommandText="usr_article_edit"
cmdquery.parameters.append cmdquery.createparameter("returncode",adinteger,adparamreturnvalue)
cmdquery.parameters.append cmdquery.createparameter("a_id",adinteger,adparaminput,,a_id)
cmdquery.parameters.append cmdquery.createparameter("c_id",adinteger,adparaminput,,request("a_c_id"))
cmdquery.parameters.append cmdquery.createparameter("t_id",adinteger,adparaminput,,request("a_t_id"))
cmdquery.parameters.append cmdquery.createparameter("u_id",adinteger,adparaminput,,id)
cmdquery.parameters.append cmdquery.createparameter("caption",adBSTR,adparaminput,,rtrim(request("caption")))
cmdquery.parameters.append cmdquery.createparameter("content",adBSTR,adparaminput,,rtrim(request("content")))
cmdquery.parameters.append cmdquery.createparameter("cost",adinteger,adparaminput,,request("cost"))
cmdquery.execute
我也不知道cmdquery("content")应该用什么类型的阐述,从msdn中找了一个adBSTR类型用着
现在的问题是,conntent长度小的时候没问题
长了就报错
为
Microsoft OLE DB Provider for ODBC Drivers 错误 '80040e21'
[Microsoft][ODBC SQL Server Driver]字符串数据,右截位
/edu/article_edit2.asp,行72
再长的话,报的错也不一样
发生意外。
不知道是不是我调用的有问题?
请大哥大姐们指教,小弟不胜感激,100分奉上,不成敬意:)
/edu/article_edit2.asp,行70