[求助]操作权限,大家来改程序
操作权限用的,qx.fields(i)的值为0和1,用户名为user_info的列,username为定义的一个字符,即为当前的登陆人。前面Adduser、pwxg等等为菜单名,求怎么改,怎么样通过username取得表中的值。If qx.State = adStateOpen Then '检测数据库是否打开状态
qx.Close
End If
sql = "select * from user_info " '连接字串"
qx.Open sql, conn, adOpenKeyset, adLockOptimistic, adCmdText '打开数据库
With qx
If .BOF = False Then .MoveFirst
qx.Find "用户名 like " + Chr(34) + UserName + Chr(34) + ""
If qx.EOF Then
Else
Adduser.Enabled = qx.Fields("添加用户")
pwxg.Enabled = qx.Fields("修改密码")
bmgl.Enabled = qx.Fields("部门管理")
szbf.Enabled = qx.Fields("数据备份")
sjhy.Enabled = qx.Fields("数据还原")
syskey.Enabled = qx.Fields("系统锁定")
cxdl1.Enabled = qx.Fields("重新登陆")
a.Enabled = qx.Fields("权限管理")
End If
End With