📄 main_xtwh_qxsz.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_xtwh_qxsz
BorderStyle = 3 'Fixed Dialog
Caption = "系统维护--【权限设置】"
ClientHeight = 4215
ClientLeft = 900
ClientTop = 795
ClientWidth = 8865
Icon = "main_xtwh_qxsz.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 4215
ScaleWidth = 8865
ShowInTaskbar = 0 'False
StartUpPosition = 1 '所有者中心
Begin VB.CommandButton Command1
Caption = "全选"
Height = 375
Left = 2325
TabIndex = 12
Top = 3660
Width = 1620
End
Begin VB.CommandButton Command2
Caption = "全不选"
Height = 375
Left = 3945
TabIndex = 11
Top = 3660
Width = 1620
End
Begin VB.CommandButton Command3
Caption = "确定"
Height = 375
Left = 5565
TabIndex = 10
Top = 3660
Width = 1620
End
Begin VB.CommandButton Command4
Caption = "退出"
Height = 375
Left = 7185
TabIndex = 9
Top = 3660
Width = 1620
End
Begin VB.Frame Frame3
Caption = "权限设置"
Height = 3270
Left = 2400
TabIndex = 4
Top = 60
Width = 6330
Begin VB.CheckBox Check1
Caption = "系统维护"
Height = 390
Index = 4
Left = 3465
TabIndex = 13
Top = 2400
Width = 1920
End
Begin VB.CheckBox Check1
Caption = "经理查询系统"
Height = 390
Index = 3
Left = 3465
TabIndex = 8
Top = 1905
Width = 1920
End
Begin VB.CheckBox Check1
Caption = "前台信息管理"
Height = 315
Index = 1
Left = 3465
TabIndex = 7
Top = 1005
Width = 2715
End
Begin VB.CheckBox Check1
Caption = "后台信息管理"
Height = 315
Index = 2
Left = 3465
TabIndex = 6
Top = 1455
Width = 2085
End
Begin VB.CheckBox Check1
Caption = "基本信息管理"
Height = 435
Index = 0
Left = 3465
TabIndex = 5
Top = 480
Width = 2205
End
Begin VB.Image Image1
Height = 1815
Left = 360
Picture = "main_xtwh_qxsz.frx":000C
Stretch = -1 'True
Top = 765
Width = 2670
End
End
Begin VB.Frame Frame1
Caption = "操作员列表"
Height = 3960
Left = 75
TabIndex = 0
Top = 75
Width = 2190
Begin VB.Frame Frame2
Caption = "Frame2"
Height = 1125
Left = 15
TabIndex = 1
Top = 2760
Visible = 0 'False
Width = 2655
Begin VB.TextBox Text1
Height = 225
Left = 75
TabIndex = 2
Text = "Text1"
Top = 165
Width = 1770
End
Begin MSAdodcLib.Adodc Adodc1
Height = 330
Left = 45
Top = 450
Width = 1905
_ExtentX = 3360
_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= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "Provider=MSDASQL.1;Persist Security Info=False;User ID=sa;Data Source=XYGLXT"
OLEDBString = "Provider=MSDASQL.1;Persist Security Info=False;User ID=sa;Data Source=XYGLXT"
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 MSAdodcLib.Adodc Adodc2
Height = 330
Left = 45
Top = 750
Width = 1905
_ExtentX = 3360
_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= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "Provider=MSDASQL.1;Persist Security Info=False;User ID=sa;Data Source=YYJXC"
OLEDBString = "Provider=MSDASQL.1;Persist Security Info=False;User ID=sa;Data Source=YYJXC"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "select * from 权限信息表"
Caption = "Adodc2"
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
End
Begin MSDataListLib.DataList DataList1
Bindings = "main_xtwh_qxsz.frx":FC93
Height = 3420
Left = 180
TabIndex = 3
Top = 330
Width = 1800
_ExtentX = 3175
_ExtentY = 6033
_Version = 393216
ListField = "操作员名称"
End
End
End
Attribute VB_Name = "main_xtwh_qxsz"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim i As Integer '定义一个整型变量
Dim rs1 As New ADODB.Recordset '定义一个数据集对象
Dim txtSQL As String '定义一个字符串变量
Private Sub Form_Activate()
For i = 0 To 4 '设置Check1(i)的值为1
Check1(i).Value = 1
Next i
'设置窗体标题栏的内容
Me.Caption = Me.Caption & " 操作员: " & frm_main.St1.Panels(3).Text
End Sub
Private Sub Form_Unload(Cancel As Integer)
frm_main.Enabled = True '设置frm_main窗体有效
End Sub
Private Sub DataList1_Click()
Text1.Text = Trim(DataList1.BoundText) '赋值给text1.text
'按操作员名称查询权限信息
txtSQL = "select * from 权限信息表 where 操作员名称='" & Trim(DataList1.BoundText) & "'"
Set rs1 = ESQL(txtSQL) '执行SQL语句
If rs1.RecordCount > 0 Then '当记录大于零时
For i = 0 To 4
'当数据库字段值为0时,Check1(i)的值为1,否则Check1(i)的值为0
If rs1.Fields(i) = 0 Then Check1(i).Value = 1 Else Check1(i).Value = 0
Next i
rs1.Update '更新记录
End If
End Sub
Private Sub Command1_Click()
For i = 0 To 4 '设置Check1(i)的值为1
Check1(i).Value = 1
Next i
End Sub
Private Sub Command2_Click()
For i = 0 To 4 '设置Check1(i)的值为0
Check1(i).Value = 0
Next i
End Sub
Private Sub Command3_Click()
If Text1.Text <> "" Then
If DataList1.BoundText <> "" Then
'按操作员名称查询权限信息
txtSQL = "select * from 权限信息表 where 操作员名称='" & DataList1.BoundText & "'"
Set rs1 = ESQL(txtSQL)
If rs1.RecordCount > 0 Then '当记录大于零时
For i = 0 To 4
'当Check1(i)的值为1时,数据库字段值为0,否则数据库字段值为1
If Check1(i).Value = 1 Then rs1.Fields(i) = 0 Else rs1.Fields(i) = 1
Next i
rs1.Update '更新记录
End If
End If
MsgBox "设置权限已完成!"
Else
MsgBox "请选择操作员!"
End If
End Sub
Private Sub Command4_Click()
Unload Me
frm_main.Enabled = True
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -