高手们,请教一个问题,
登录系统成功后,按当前登录账号的角色判断需要加载的数据,代码写在登录窗口确定按键中
BeforeLoadOuterTable 这个里面的事件都不能用了
下面这种方式不行
If _UserRoles = "业务员" Then
DataTables("maintable").Fill("Select * From {maintable} Where [zhuangtai] = '未完成' and [tianbaoren] = '" & _UserName & "'", False)
DataTables("kehu").fill("Select * From {kehu} Where [chuangjian] = '" & _UserName & "'",False)
这种写法不行,提示不能使用动态SQL
下面这种也不行,
Dim sql As New SQLCommand
If _UserRoles = "总经理" Then
sql.CommandText = "Select * From {maintable} Where [jigou] = '" & _UserGroup & "'"
sql.CommandText = "Select * From {kehu} Where [jigou] = '" & _UserGroup & "'"
End If
高手帮忙完善一下,谢谢
If _UserRoles = "业务员" Then
sql.CommandText = "Select * From {maintable} Where [zhuangtai] = '未完成' and [tianbaoren] = '" & ren & "'"
sql.CommandText = "Select * From {kehu} Where [chuangjian] = '" & ren & "'"
ElseIf _UserRoles = "总经理" Then
sql.CommandText = "Select * From {maintable} Where [jigou] = '" & jg & "'"
sql.CommandText = "Select * From {kehu} Where [jigou] = '" & jg & "'"
ElseIf _UserRoles = "管理员" Then
sql.CommandText = "Select * From {maintable}"
sql.CommandText = "Select * From {kehu}"
End If
[此贴子已经被作者于2014-1-26 17:01:17编辑过]