以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  导航窗口异常  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=135350)

--  作者:有点甜
--  发布时间:2019/5/24 12:06:00
--  

加入msgbox,定位哪个代码出错

 

http://www.foxtable.com/webhelp/scr/1485.htm

 


--  作者:有点甜
--  发布时间:2019/5/24 12:35:00
--  

Dim trv = e.form.controls("TreeView1")

msgbox(_UserGroup = Nothing)

If _UserGroup.contains("质量部") =False And _UserGroup.contains("管理员") = False And _UserGroup.contains("经理") = False   Then

msgbox(2)

    trv.nodes("质量控制").delete

msgbox(3)

End If

msgbox(4)


--  作者:有点甜
--  发布时间:2019/5/24 14:52:00
--  

改成

 

Dim trv = e.form.controls("TreeView1")
If _UserGroup = Nothing Then  
    msgbox("没有分组")  
Else   
    If _UserGroup.contains("质量部") =False And _UserGroup.contains("管理员") = False And _UserGroup.contains("经理") = False   Then       
        trv.nodes("质量控制").delete       
    End If   
End If


--  作者:有点甜
--  发布时间:2019/5/24 16:25:00
--  

 

那就是你登陆的时候,没有给 _UserGroup 赋值

 


--  作者:有点甜
--  发布时间:2019/5/24 18:27:00
--  

msgbox(1)

If e.Form.Controls("PassWord").Value = dr("Password") Then
    _UserName = UserName
    _UserGroup = dr("Group")

msgbox(_UserGroup)
    e.Form.Close
Else
    Messagebox.show("密码错误!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
End If


--  作者:有点蓝
--  发布时间:2019/5/25 9:29:00
--  
1、之后有其它代码重新给_usergroup赋值了
2、在登录赋值之前就使用了_usergroup

导航窗口是不是设置了自动打开?去掉自动打开,然后在登录后使用代码打开窗口

--  作者:有点蓝
--  发布时间:2019/5/25 10:07:00
--  
输出代码,搜索一下看看有没有其它地方重新给_usergroup赋值
--  作者:有点蓝
--  发布时间:2019/5/25 10:47:00
--  
输出整个项目的代码,自己搜索
--  作者:有点蓝
--  发布时间:2019/5/25 11:16:00
--  
做个例子发上来测试一下
--  作者:有点蓝
--  发布时间:2019/5/25 14:20:00
--  
代码没有问题,不是这里的原因。6楼7楼的提示很明显是_UserGroup没有值引起的错误