错误:
Microsoft OLE DB Provider for SQL Server 错误 80040e10
过程 sp_new_AllRecord 需要参数 @middleid,但未提供该参数。
----------存储过程目的统计记录总数------------------
ALTER procedure sp_new_AllRecord
@middleid nvarchar(10)
As
select count(id) As allid from allenterprise where left(newtype,3)=@middleid
在Asp页面中引用:
sub AllRecord(middleid)
set cmd=server.CreateObject("adodb.command")
cmd.ActiveConnection=conn
cmd.commandtext="sp_new_AllRecord"
set ttt=cmd.execute
if not ttt.eof then
response.write ttt("allid")
end if
ttt.close
set cmd=nothing
end sub
conn.close
set conn=nothing
TRY:
sub AllRecord(middleid)
set cmd=server.CreateObject("adodb.command")
cmd.ActiveConnection=conn
cmd.commandtext="sp_new_AllRecord 传入参数"
set ttt=cmd.execute
if not ttt.eof then
response.write ttt("allid")
end if
ttt.close
set cmd=nothing
end sub
conn.close
set conn=nothing
缺少输入参数:
cmd.commandtext="sp_new_AllRecord 001 "
@middleid,你的存储过程定义了一个参数,你没有传参数当然不行,你把参数传上去就行了
至于参数怎么传,你自己查一下asp的帮助,看看comman怎么传
好像是command.parameters.add("@middleid",参数值,参数类型)
我记得不是很请楚了