怎么判断登录用户是否管理员?

来源:百度知道 编辑:UC知道 时间:2024/05/17 22:03:58
<!--删除响应函数-->
<SCRIPT FOR="DeleteButton" EVENT="onClick" LANGUAGE="VBScript">
Dim TheForm
Set TheForm = Document.forms("Productfm")
dim isAdmin
set rs=conn.execute("select isGrpAdmin from [tblUser] where usrID="&Session("Session_User") )
if rs.eof and rs.bof then
isAdmin=0
else
isAdmin=rs(0)
end if

if isAdmin!=1 then
MsgBox "你不能删除当前记录!",48,"警告"
else
Dim MyVar
MyVar = MsgBox ("你确认要删除选中的销售记录么?",52, "确认删除")
if MyVar = 6 then
TheForm.act.value="del"
TheForm.submit()
end if
end if
rs.close set rs=nothing

</SCRIPT>

为什么没有实现删除?
改了,还是没有实现删除。
也没提示错误,只是点

f isAdmin!=1 then
改为f isAdmin<>1 then
!=是JAVA语法

'#################################################################################
'建议你用response.write rs(0),跟踪一下
'如果usrID是什么类型。如果是字符串类型那应该用"select isGrpAdmin from [tblUser] where usrID='"&Session("Session_User") "'"
用'将输入的值括起来