在使用ASP 调用存储过程中 参数声明中ntext类型应该如何声明?还有数据长度必须指定吗?Set MyComm = Server.CreateObject("ADODB.Command")
with MyComm
.ActiveConnection = conn
.CommandText = "configSAVE"
.CommandType = 4
.Prepared = true
.Parameters.Append .CreateParameter("@webtitle",200,1,200,P1) '//参数顺序:参数名,参数数据类型,参数类型,数据长度,参数值
......类推.......Execute
end with
存储过程如下
CREATE PROCEDURE configSAVE
@webtitle nvarchar(200),
@webtitle_cn nvarchar(200),
@webkey varchar(200),
@webkey_cn varchar(200),
@webDescription ntext,
@webDescription_cn ntext,
@weblogo varchar(100),
@webbanner varchar(100),
@Languages int,
@Download int,
@Emails varchar(50),
@smtpname varchar(50),
@smtppass varchar(50),
@smtpserver varchar(50),
@setline int,
@Efromname varchar(100),
@Esubject nvarchar(200),
@mailbox varchar(100)ASset nocount onbegin
update WebConfig set webtitle=@webtitle,webtitle_cn=@webtitle_cn,webkey=@webkey,webkey_cn=@webkey_cn,webDescription=@webDescription,webDescription_cn=@webDescription_cn,weblogo=@weblogo,webbanner=@webbanner,Languages=@Languages,Download=@Download,Emails=@Emails,SMTPServer=@SMTPServer,SMTPpass=@SMTPpass,SMTPname=@SMTPname,SetLine=@Setline,Efromname=@Efromname,Esubject=@Esubject,mailbox=@mailbox
endset nocount off
GO
with MyComm
.ActiveConnection = conn
.CommandText = "configSAVE"
.CommandType = 4
.Prepared = true
.Parameters.Append .CreateParameter("@webtitle",200,1,200,P1) '//参数顺序:参数名,参数数据类型,参数类型,数据长度,参数值
......类推.......Execute
end with
存储过程如下
CREATE PROCEDURE configSAVE
@webtitle nvarchar(200),
@webtitle_cn nvarchar(200),
@webkey varchar(200),
@webkey_cn varchar(200),
@webDescription ntext,
@webDescription_cn ntext,
@weblogo varchar(100),
@webbanner varchar(100),
@Languages int,
@Download int,
@Emails varchar(50),
@smtpname varchar(50),
@smtppass varchar(50),
@smtpserver varchar(50),
@setline int,
@Efromname varchar(100),
@Esubject nvarchar(200),
@mailbox varchar(100)ASset nocount onbegin
update WebConfig set webtitle=@webtitle,webtitle_cn=@webtitle_cn,webkey=@webkey,webkey_cn=@webkey_cn,webDescription=@webDescription,webDescription_cn=@webDescription_cn,weblogo=@weblogo,webbanner=@webbanner,Languages=@Languages,Download=@Download,Emails=@Emails,SMTPServer=@SMTPServer,SMTPpass=@SMTPpass,SMTPname=@SMTPname,SetLine=@Setline,Efromname=@Efromname,Esubject=@Esubject,mailbox=@mailbox
endset nocount off
GO
但是我并不是要 写存储过程 中 的参数声明,而是要 ASP调用时的参数声明。
.Parameters.Append .CreateParameter("@webtitle",adLongVarChar,1,100000000,P1)//或者:.Parameters.Refresh
.Parameters("@webtitle")=P1