ASP 中自定义函数参数值接不到

来源:百度知道 编辑:UC知道 时间:2024/05/16 03:39:30
public function quanxian(qx)

set rsp=server.CreateObject("adodb.recordset")
sql="select qx_name from whk_qx,whk_role where whk_qx.role_id=whk_role.role_id and whk_qx.role_id="&session("js_id")&" and user_id="&session("user_id")
rsp.open sql,conn,1,1

aaa=rsp("qx_name")
qx1=split(aaa , ",")

ll=ubound(qx1)
for i=0 to ll-1
if qx1(i)=qx then

response.Write("有权限")
exit for
end if
next
end function
在线等 QQ 306961674 解决问题加分 谢谢了

response.Write("有权限") 是 quanxian="有权限" 做NET的 不熟悉ASP语言我快疯了 谁赶紧来给我解答呀

你的函数没有返回值。只有输出内容。
如果要返回值应该在end function 前面加一句quanxian="某某值"
调用时要这样:result=quanxian(...) 这样可以把某某值返回给result变量。

public function quanxian(qx)
quanxian=""
set rsp=server.CreateObject("adodb.recordset")
sql="select qx_name from whk_qx,whk_role where whk_qx.role_id=whk_role.role_id and whk_qx.role_id="&session("js_id")&" and user_id="&session("user_id")
rsp.open sql,conn,1,1

aaa=rsp("qx_name")
qx1=split(aaa , ",")

ll=ubound(qx1)
for i=0 to ll-1
if qx1(i)=qx then

quanxian="有权限"
exit for
end if
next
end function

quanxian1=quanxian(qx)

response.write quanxian1

没看到你怎么调用啊