?? main_xtgl_qxgl.frm
字號:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{F0D2F211-CCB0-11D0-A316-00AA00688B10}#1.0#0"; "MSDATLST.OCX"
Begin VB.Form main_xtgl_qxgl
Caption = "系統管理-【權限管理】"
ClientHeight = 3300
ClientLeft = 60
ClientTop = 345
ClientWidth = 5250
LinkTopic = "Form1"
ScaleHeight = 3300
ScaleWidth = 5250
StartUpPosition = 1 '所有者中心
Begin VB.Frame Frame2
Caption = "權限設置"
Height = 2115
Left = 1425
TabIndex = 6
Top = 705
Width = 3765
Begin VB.CheckBox Check1
Caption = "系統管理"
Height = 240
Index = 4
Left = 2325
TabIndex = 15
Top = 390
Width = 1095
End
Begin VB.CheckBox Check1
Caption = "基礎信息管理"
Height = 240
Index = 0
Left = 300
TabIndex = 11
Top = 390
Width = 1410
End
Begin VB.CheckBox Check1
Caption = "圖書管理"
Height = 240
Index = 1
Left = 300
TabIndex = 10
Top = 795
Width = 1065
End
Begin VB.CheckBox Check1
Caption = "借閱管理"
Height = 240
Index = 2
Left = 300
TabIndex = 9
Top = 1200
Width = 1155
End
Begin VB.CheckBox Check1
Caption = "決策分析"
Height = 240
Index = 3
Left = 300
TabIndex = 8
Top = 1605
Width = 1095
End
Begin VB.CheckBox Check1
Caption = "系統維護"
Height = 240
Index = 5
Left = 2325
TabIndex = 7
Top = 795
Width = 1095
End
End
Begin VB.CommandButton Command1
Caption = "全選"
Height = 360
Left = 1515
TabIndex = 5
Top = 2880
Width = 870
End
Begin VB.CommandButton Command2
Caption = "全不選"
Height = 360
Left = 2415
TabIndex = 4
Top = 2880
Width = 870
End
Begin VB.CommandButton Command3
Caption = "確定"
Height = 360
Left = 3315
TabIndex = 3
Top = 2880
Width = 870
End
Begin VB.CommandButton Command4
Caption = "退出"
Height = 360
Left = 4215
TabIndex = 2
Top = 2880
Width = 870
End
Begin MSDataListLib.DataList DataList1
Bindings = "main_xtgl_qxgl.frx":0000
Height = 2160
Left = 60
TabIndex = 0
Top = 960
Width = 1275
_ExtentX = 2249
_ExtentY = 3810
_Version = 393216
ListField = "操作員"
End
Begin MSAdodcLib.Adodc Adodc1
Height = 330
Left = -1020
Top = 1980
Visible = 0 'False
Width = 1305
_ExtentX = 2302
_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 = "DSN=NBooks"
OLEDBString = ""
OLEDBFile = ""
DataSourceName = "NBooks"
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "select * from qxb"
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.Frame Frame1
Height = 555
Left = 60
TabIndex = 12
Top = 0
Width = 5145
Begin VB.ComboBox Combo1
Height = 300
Left = 1395
TabIndex = 13
Text = "Combo1"
Top = 165
Width = 3510
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "操作員級別:"
Height = 210
Left = 225
TabIndex = 14
Top = 240
Width = 1155
End
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "操作員列表"
Height = 180
Left = 75
TabIndex = 1
Top = 690
Width = 1140
End
End
Attribute VB_Name = "main_xtgl_qxgl"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim i, a As Integer '聲明整型變量
Dim rs1 As New ADODB.Recordset '聲明數據集對象
Private Sub Find() '聲明過程
'查詢操作員級別
Adodc1.RecordSource = "select * from qxb where 操作員級別='" + Combo1.text + "'"
Adodc1.Refresh
'根據操作員級別給定權限范圍
If Combo1.text = "系統管理員" Then
a = 5
Check1(4).Enabled = True
Check1(5).Enabled = True
End If
If Combo1.text = "高級操作員" Then
a = 4
Check1(4).Enabled = True
Check1(5).Enabled = False
End If
If Combo1.text = "普通操作員" Then
a = 3
Check1(4).Enabled = False
Check1(5).Enabled = False
End If
End Sub
Private Sub Form_Load()
'添加操作員級別列表
Combo1.AddItem ("系統管理員")
Combo1.AddItem ("高級操作員")
Combo1.AddItem ("普通操作員")
Combo1.ListIndex = 0
Call Find '調用過程
End Sub
Private Sub Form_Unload(Cancel As Integer)
frm_main.Enabled = True
End Sub
Private Sub Combo1_Click()
Call Find '調用過程
For i = 0 To 5
Check1(i).Value = 0
Next i
End Sub
Private Sub DataList1_Click()
'按操作員查詢記錄
rs1.Open "select * from qxb where 操作員='" + DataList1.text + "'", Cnn, adOpenKeyset, adLockOptimistic
If rs1.RecordCount > 0 Then '假如記錄大于零
'瀏覽操作員權限
For i = 0 To 5
If rs1.Fields(i) = True Then Check1(i).Value = 1 Else Check1(i).Value = 0
Next i
End If
rs1.Close
End Sub
Private Sub Command1_Click() '全選
For i = 0 To a
Check1(i).Value = 1
Next i
End Sub
Private Sub Command2_Click() '全不選
For i = 0 To a
Check1(i).Value = 0
Next i
End Sub
Private Sub Command3_Click()
If DataList1.SelectedItem Then '假如選定操作員
'給選定的操作員賦予權限
rs1.Open "select * from qxb where 操作員='" + DataList1.text + "'", Cnn, adOpenKeyset, adLockOptimistic
If rs1.RecordCount > 0 Then
For i = 0 To 5
If Check1(i).Value = 1 Then rs1.Fields(i) = True Else rs1.Fields(i) = False
Next i
rs1.Update
End If
rs1.Close
MsgBox "操作員權限設置成功!"
Else
MsgBox "請選擇操作員!"
End If
End Sub
Private Sub Command4_Click()
frm_main.Enabled = True
Unload Me
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -