📄 权限设置.frm
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomctl.ocx"
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form 权限设置
Caption = "权限设置"
ClientHeight = 6075
ClientLeft = 60
ClientTop = 345
ClientWidth = 9105
LinkTopic = "Form1"
ScaleHeight = 6075
ScaleWidth = 9105
StartUpPosition = 3 '窗口缺省
Begin VB.Frame Frame1
Caption = "用户权限设置"
Height = 5415
Left = 3000
TabIndex = 5
Top = 120
Width = 6015
Begin VB.CheckBox Check1
Caption = "Check1"
Height = 375
Index = 15
Left = 3480
TabIndex = 21
Top = 4800
Width = 1935
End
Begin VB.CheckBox Check1
Caption = "Check1"
Height = 375
Index = 14
Left = 3480
TabIndex = 20
Top = 4200
Width = 1935
End
Begin VB.CheckBox Check1
Caption = "Check1"
Height = 375
Index = 13
Left = 3480
TabIndex = 19
Top = 3600
Width = 1935
End
Begin VB.CheckBox Check1
Caption = "Check1"
Height = 375
Index = 12
Left = 3480
TabIndex = 18
Top = 2880
Width = 1935
End
Begin VB.CheckBox Check1
Caption = "Check1"
Height = 375
Index = 11
Left = 3480
TabIndex = 17
Top = 2280
Width = 1935
End
Begin VB.CheckBox Check1
Caption = "Check1"
Height = 375
Index = 10
Left = 3480
TabIndex = 16
Top = 1680
Width = 1935
End
Begin VB.CheckBox Check1
Caption = "Check1"
Height = 375
Index = 9
Left = 3480
TabIndex = 15
Top = 1080
Width = 1935
End
Begin VB.CheckBox Check1
Caption = "Check1"
Height = 375
Index = 8
Left = 3480
TabIndex = 14
Top = 480
Width = 1935
End
Begin VB.CheckBox Check1
Caption = "Check1"
Height = 375
Index = 7
Left = 120
TabIndex = 13
Top = 4800
Width = 1935
End
Begin VB.CheckBox Check1
Caption = "Check1"
Height = 375
Index = 6
Left = 120
TabIndex = 12
Top = 4200
Width = 1935
End
Begin VB.CheckBox Check1
Caption = "Check1"
Height = 375
Index = 5
Left = 120
TabIndex = 11
Top = 3600
Width = 1935
End
Begin VB.CheckBox Check1
Caption = "Check1"
Height = 375
Index = 4
Left = 120
TabIndex = 10
Top = 2880
Width = 1935
End
Begin VB.CheckBox Check1
Caption = "Check1"
Height = 375
Index = 3
Left = 120
TabIndex = 9
Top = 2280
Width = 1935
End
Begin VB.CheckBox Check1
Caption = "Check1"
Height = 375
Index = 2
Left = 120
TabIndex = 8
Top = 1680
Width = 1935
End
Begin VB.CheckBox Check1
Caption = "Check1"
Height = 375
Index = 1
Left = 120
TabIndex = 7
Top = 1080
Width = 1935
End
Begin VB.CheckBox Check1
Caption = "Check1"
Height = 375
Index = 0
Left = 120
TabIndex = 6
Top = 480
Width = 1935
End
End
Begin MSAdodcLib.Adodc Adodc1
Height = 330
Left = 360
Top = 5760
Width = 1575
_ExtentX = 2778
_ExtentY = 582
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 1
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 3
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "select * from 用户权限表"
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.CommandButton Command4
Caption = "退出"
Height = 375
Left = 7800
TabIndex = 4
Top = 5640
Width = 1095
End
Begin VB.CommandButton Command3
Caption = "确定"
Height = 375
Left = 6240
TabIndex = 3
Top = 5640
Width = 1215
End
Begin VB.CommandButton Command2
Caption = "全不选"
Height = 375
Left = 4680
TabIndex = 2
Top = 5640
Width = 1335
End
Begin VB.CommandButton Command1
Caption = "全选"
Height = 375
Left = 3120
TabIndex = 1
Top = 5640
Width = 1215
End
Begin MSComctlLib.ImageList ImageList1
Left = 2160
Top = 5520
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
ImageWidth = 80
ImageHeight = 80
MaskColor = 12632256
_Version = 393216
BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
NumListImages = 6
BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "权限设置.frx":0000
Key = "zhu"
Object.Tag = "zhu"
EndProperty
BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "权限设置.frx":0D59
Key = "zxf"
Object.Tag = "zxf"
EndProperty
BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "权限设置.frx":19E9
Key = "fff"
Object.Tag = "fff"
EndProperty
BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "权限设置.frx":263C
Key = ""
EndProperty
BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "权限设置.frx":3395
Key = ""
EndProperty
BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "权限设置.frx":3FE8
Key = ""
EndProperty
EndProperty
End
Begin MSComctlLib.ListView ListView1
Height = 5415
Left = 240
TabIndex = 0
Top = 120
Width = 2655
_ExtentX = 4683
_ExtentY = 9551
LabelWrap = -1 'True
HideSelection = -1 'True
_Version = 393217
ForeColor = -2147483640
BackColor = -2147483643
BorderStyle = 1
Appearance = 1
NumItems = 0
End
End
Attribute VB_Name = "权限设置"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim rs11 As New ADODB.Recordset
Dim rs2 As New ADODB.Recordset
Dim i As Integer
Dim itmX As ListItem '声明一个ListItem对象
Dim MyIcon As Integer '声明一个整型变量
Dim Mystr, MyMsg As String '声明字符串变量
Private Sub Command4_Click()
Unload Me
End Sub
Private Sub Form_Load()
Adodc1.ConnectionString = PublicStr '数据连接
rs11.Open "select * from 用户权限表", cnn, adOpenKeyset, adLockOptimistic '打开数据对象
For i = 0 To Check1.UBound
'向控件中添加字段
Check1(i).Caption = rs11.Fields(i).Name
Next i
rs11.Close
rs2.Open "select * from 用户表", cnn, adOpenStatic
If rs2.RecordCount > 0 Then
rs2.MoveFirst
'向ListView中添加图片
Do While rs2.EOF = False
ListView1.View = 0
ListView1.Icons = ImageList1.object
Mystr = rs2.Fields("用户名")
MyIcon = Val(Right(rs2.Fields("头像"), Val(Len(rs2.Fields("头像")))))
Set itmX = ListView1.ListItems.Add(, , Mystr, MyIcon)
rs2.MoveNext
Loop
End If
rs2.Close
End Sub
Private Sub Form_Unload(Cancel As Integer)
学生信息管理系统.Enabled = True
End Sub
Private Sub Command1_Click() '全选
For i = 0 To Check1.UBound
Check1(i).Value = 1
Next i
End Sub
Private Sub Command2_Click() '全不选
For i = 0 To Check1.UBound
Check1(i).Value = 0
Next i
End Sub
Private Sub Command3_Click() '为操作员设置权限
Adodc1.RecordSource = "select * from 用户表 where 用户名 ='" + ListView1.SelectedItem + "'"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
For i = 0 To Check1.UBound
Adodc1.Recordset.Fields(i) = Check1(i).Value
Next i
Adodc1.Recordset.Update
Adodc1.Refresh
MsgBox "操作员权限设置成功!", , "信息提示"
End If
End Sub
Private Sub ListView1_Click() '查看操作员权限
Adodc1.RecordSource = "select * from 用户权限表 where 用户名 ='" + ListView1.SelectedItem + "'"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
For i = 4 To Check1.UBound
If Adodc1.Recordset.Fields(i) = "" Then
Check1(i).Value = 0
Else
Check1(i).Value = Adodc1.Recordset.Fields(i)
End If
Next i
Adodc1.Recordset.Update '更新数据记录
Adodc1.Refresh
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -