ado怎样调用存储过程
发布网友
发布时间:2022-04-15 04:55
我来回答
共3个回答
懂视网
时间:2022-04-15 09:16
adonewmysql存储过程
OUT or INOUT argument 2 for routine test.test5 is not a variable or NEW
热心网友
时间:2022-04-15 06:24
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.open strConn
if err.number<>0 then
response.Write "数据库链接失败。" '& err.Description
response.End
end If
set Rs = server.CreateObject("adodb.recordset")
'调用存储过程:[dbo].[Usp_GetUserMenu]
strsql="[dbo].[Usp_GetUserMenu] @UserID='"&Session(g_SessionName&"_UserID")&"'"
'这句话是关键,CursorLocation意思是游标本地化
rs.CursorLocation=3
Rs.open strsql,conn,1,1
if err.number<>0 Then
conn.close
set conn=nothing
end if
for i=1 to rs.RecordCount
iMenuType=rs("MenuType")
......
rs.MoveNext
next
rs.Close
set rs=nothing
conn.close
set conn=nothing
热心网友
时间:2022-04-15 07:42
'不返回值的执行存储过程
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.open ConnStr
conn.execute("exec aaa 'ddd'");
'带输出的。
Const adParamInput = &H0001
Const adParamOutput = &H0002
Const adParamInputOutput = &H0003
Const adVarWChar = 202
Const adInteger = 3
Const adBigInt = 20
set recom = server.createobject("adodb.command")
recom.activeconnection = ConnStr
recom.commandtype = 4
recom.CommandTimeout = 0
recom.Prepared = true
recom.commandtext = "dbo.SP_Pagination"
recom.Parameters.Append recom.CreateParameter("@TableName",adVarWChar,adParamInput,500,TableName)
recom.Parameters.Append recom.CreateParameter("@ReFieldsStr",adVarWChar,adParamInput,5000,ReFieldsStr)
recom.Parameters.Append recom.CreateParameter("@OrderString",adVarWChar,adParamInput,200,OrderString)
recom.Parameters.Append recom.CreateParameter("@WhereString",adVarWChar,adParamInput,5000,Sqlwhere)
recom.Parameters.Append recom.CreateParameter("@PageSize",adInteger,adParamInput,3,maxpage)
recom.Parameters.Append recom.CreateParameter("@PageIndex",adInteger,adParamInput,3,page)
set rs=recom.execute()