📄 form6.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form Form6
BackColor = &H00FFC0C0&
BorderStyle = 1 'Fixed Single
Caption = "用户权限设置"
ClientHeight = 3870
ClientLeft = 45
ClientTop = 330
ClientWidth = 7095
LinkTopic = "Form6"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3870
ScaleWidth = 7095
StartUpPosition = 3 '窗口缺省
Begin VB.TextBox Text2
Height = 480
Left = 6555
TabIndex = 10
Text = "Text2"
Top = 5115
Width = 960
End
Begin VB.TextBox Text1
Height = 435
Left = 450
TabIndex = 9
Text = "Text1"
Top = 4965
Width = 750
End
Begin MSAdodcLib.Adodc Adodc1
Height = 330
Left = 1965
Top = 5115
Width = 4005
_ExtentX = 7064
_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=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=test;Data Source=(local)"
OLEDBString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=test;Data Source=(local)"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
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 Command2
BackColor = &H00FF8080&
Cancel = -1 'True
Caption = "返回(&E)"
Height = 435
Left = 4920
Style = 1 'Graphical
TabIndex = 8
Top = 2310
Width = 1140
End
Begin VB.CommandButton Command1
BackColor = &H00FF8080&
Caption = "授权(&A)"
Default = -1 'True
Height = 435
Left = 3570
Style = 1 'Graphical
TabIndex = 7
Top = 2280
Width = 1140
End
Begin VB.Frame Frame2
BackColor = &H00FFC0C0&
Caption = "请选择相应的操作员"
Height = 1770
Left = 3420
TabIndex = 1
Top = 330
Width = 2760
Begin VB.ComboBox Combo1
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 330
Left = 375
Style = 2 'Dropdown List
TabIndex = 2
Top = 300
Width = 2115
End
End
Begin VB.Frame Frame1
BackColor = &H00FFC0C0&
Caption = "设置权限"
Height = 2490
Left = 120
TabIndex = 0
Top = 240
Width = 3150
Begin VB.CheckBox Check5
BackColor = &H00FFC0C0&
Caption = "系统设置"
Height = 270
Left = 315
TabIndex = 11
Top = 1725
Width = 1230
End
Begin VB.CheckBox Check4
BackColor = &H00FFC0C0&
Caption = "基本信息维护"
Height = 330
Left = 1635
TabIndex = 6
Top = 1125
Width = 1470
End
Begin VB.CheckBox Check3
BackColor = &H00FFC0C0&
Caption = "打印报表"
Height = 435
Left = 1650
TabIndex = 5
Top = 495
Width = 1155
End
Begin VB.CheckBox Check2
BackColor = &H00FFC0C0&
Caption = "设备管理"
Height = 300
Left = 315
TabIndex = 4
Top = 1155
Width = 1080
End
Begin VB.CheckBox Check1
BackColor = &H00FFC0C0&
Caption = "用户设置"
Height = 345
Left = 315
TabIndex = 3
Top = 510
Width = 1080
End
End
End
Attribute VB_Name = "Form6"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Combo1_Click()
Adodc1.RecordSource = "select * from Table1_user where 帐号='" + Combo1.Text + "'"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
Check1.Value = Adodc1.Recordset.Fields("功能一")
Check2.Value = Adodc1.Recordset.Fields("功能二")
Check3.Value = Adodc1.Recordset.Fields("功能三")
Check4.Value = Adodc1.Recordset.Fields("功能四")
Check5.Value = Adodc1.Recordset.Fields("功能五")
Else
End If
End Sub
Private Sub Command1_Click()
If Combo1.Text = "wtl" Then
MsgBox "您不能修改超级用户权限!", 48, "选择错误"
Exit Sub
End If
Call main
Adodc1.RecordSource = "select * from Table1_user where 帐号='" + Combo1.Text + "'"
Adodc1.Refresh
Text1.Text = Adodc1.Recordset.Fields("帐号")
Text2.Text = Adodc1.Recordset.Fields("密码")
Adodc1.Recordset.Delete
Adodc1.Refresh
Set adoRs = adoCon.Execute("insert into Table1_user values('" & Text1.Text & "','" & Text2.Text & "','" & Check1.Value & "','" & Check2.Value & "','" & Check3.Value & "','" & Check4.Value & "','" & Check5.Value & "')")
MsgBox "成功授权!!", 48, "用户管理系统"
adoCon.Close
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
Me.Left = (Screen.Width - Me.Width) / 2
Me.Top = (Screen.Height - Me.Height) / 2
Adodc1.RecordSource = "select * from Table1_user"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
Adodc1.Recordset.MoveFirst
Do While Adodc1.Recordset.EOF = False
Combo1.AddItem (Adodc1.Recordset.Fields("帐号"))
Adodc1.Recordset.MoveNext
Loop
Else
End If
'Combo1.Value = 0
Combo1.ListIndex = 0
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -