'建一个command对象
set comm = server.CreateObject ("adodb.command")
'建立连接
comm.ActiveConnection = conn
'设置command调用类型是存储过程 (adCmdSPStoredProc = 4)
comm.CommandType = 4
'定义command 对象调用名称
comm.CommandText = "P_advkind"
'定义输入参数
set CommPa1 = comm.CreateParameter ("参数1" , adVarChar , adParamInput , 10 , "参数1")
set CommPa2 = comm.CreateParameter ("参数2" , VarChar ,adParamInput ,20 , 参数2)
set CommPa3 = comm.CreateParameter ("参数3" ,varChar ,adParamInput ,100 , 参数3)
set CommPa4 = comm.CreateParameter ("参数4" ,vrChar ,adParamInput ,1000 , 参数4)
AddPadd 4
'运行存储过程
comm.Execute
'清空对象
Set comm.ActiveConnection = nothing
Set comm = nothing
Response.Redirect "/success.asp?zho="&server.URLEncode ("添加成功!")
CloseDB
sub AddPadd(num)
dim i
for i=1 to num
execute "comm.Parameters.Append CommPa"&i
next
end sub
%>