📄 frm_szygl.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form Frm_czygl
Caption = "操作员管理"
ClientHeight = 2910
ClientLeft = 60
ClientTop = 345
ClientWidth = 5175
Icon = "Frm_szygl.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 2910
ScaleWidth = 5175
StartUpPosition = 2 '屏幕中心
Begin VB.TextBox Text4
DataField = "密码"
DataSource = "Adodc1"
Height = 300
Left = 4245
TabIndex = 14
Text = "Text4"
Top = 3405
Width = 1335
End
Begin VB.Frame Frame3
Height = 705
Left = 255
TabIndex = 9
Top = 2145
Width = 4545
Begin VB.CommandButton Command1
Caption = "增删用户"
Height = 375
Left = 105
TabIndex = 13
Top = 195
Width = 1000
End
Begin VB.CommandButton Command2
Caption = "修改密码"
Enabled = 0 'False
Height = 375
Left = 1185
TabIndex = 12
Top = 195
Width = 1000
End
Begin VB.CommandButton Command3
Caption = "密码确定"
Height = 375
Left = 2265
TabIndex = 11
Top = 195
Width = 1000
End
Begin VB.CommandButton Command4
Caption = "退出"
Height = 375
Left = 3345
TabIndex = 10
Top = 195
Width = 1000
End
End
Begin MSAdodcLib.Adodc Adodc1
Height = 405
Left = 1785
Top = 3225
Width = 2145
_ExtentX = 3784
_ExtentY = 714
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 = ""
OLEDBString = ""
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.Frame Frame2
Height = 2040
Left = 3120
TabIndex = 6
Top = 60
Width = 1995
Begin VB.Label Label5
Caption = $"Frm_szygl.frx":1C7A
Height = 1665
Left = 105
TabIndex = 7
Top = 255
Width = 1770
End
End
Begin VB.Frame Frame1
Caption = "用户密码"
Height = 2040
Left = 60
TabIndex = 0
Top = 60
Width = 3030
Begin VB.TextBox Text3
Height = 300
IMEMode = 3 'DISABLE
Left = 1365
PasswordChar = "*"
TabIndex = 5
Top = 1530
Visible = 0 'False
Width = 1395
End
Begin VB.TextBox Text2
Height = 300
IMEMode = 3 'DISABLE
Left = 1365
PasswordChar = "*"
TabIndex = 4
Top = 1080
Visible = 0 'False
Width = 1395
End
Begin VB.TextBox Text1
Height = 300
IMEMode = 3 'DISABLE
Left = 1365
PasswordChar = "*"
TabIndex = 3
Top = 675
Width = 1395
End
Begin VB.ComboBox Combo1
Height = 300
Left = 1380
Style = 2 'Dropdown List
TabIndex = 2
Top = 255
Width = 1350
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "请选择操作员"
Height = 180
Left = 240
TabIndex = 17
Top = 330
Width = 1080
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "请输入新密码"
Height = 180
Left = 240
TabIndex = 16
Top = 1170
Visible = 0 'False
Width = 1080
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "请确认新密码"
Height = 180
Left = 240
TabIndex = 15
Top = 1575
Visible = 0 'False
Width = 1080
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "请输入密码"
Height = 180
Left = 240
TabIndex = 1
Top = 735
Width = 1080
End
End
Begin VB.Label Label6
Caption = "Label6"
DataField = "操作员姓名"
DataSource = "Adodc1"
Height = 315
Left = 345
TabIndex = 8
Top = 3720
Width = 1110
End
End
Attribute VB_Name = "Frm_czygl"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub Form_Load()
'自动识别路径
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\db_wygl.mdb;Persist Security Info=False"
Adodc1.RecordSource = "select * from tab_power"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then '如果记录数大于零
Adodc1.Recordset.MoveFirst '移至第一条
Do While Adodc1.Recordset.EOF = False
Combo1.AddItem Label6.Caption '向Combo1中添加数据项
Adodc1.Recordset.MoveNext '移到下一条记录
Loop
End If
End Sub
Private Sub Command1_Click() '增删用户
Frm_yhgl.Show '调入用户管理窗体
Unload Me
End Sub
Private Sub Command2_Click() '修改密码
If Text2.Text = Text3.Text Then
Text4.Text = Text2.Text
Adodc1.Recordset.Update ("密码"), Text4.Text
MsgBox "修改成功", , "系统提示"
Text2.Visible = False
Text3.Visible = False
Label3.Visible = False
Label4.Visible = False
Command2.Enabled = False '修改按钮不可用
Command3.Enabled = True '密码确定按钮可用
Adodc1.Refresh
Else
MsgBox "密码不一致请重新输入!", , "系统提示"
Text3.Text = "" '清空文本信息
Text3.SetFocus '设置焦点
End If
End Sub
Private Sub Command3_Click() '密码确定
Adodc1.RecordSource = "select * from tab_power where 操作员姓名 = '" + Combo1.Text + "' "
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then '如果记录数大于零
If Text1.Text = Text4.Text Then
Text2.Visible = True
Text3.Visible = True
Label3.Visible = True
Label4.Visible = True
Command2.Enabled = True '修改密码按钮可用
Command3.Enabled = False '密码确定按钮不可用
Text2.SetFocus
Else
MsgBox "输入的密码错误,请重新输入", , "系统提示"
Text1.Text = "" '清空文本信息
Text1.SetFocus '设置焦点
End If
End If
End Sub
Private Sub Command4_Click() '退出
Unload Me
End Sub
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then Command3.SetFocus
End Sub
Private Sub Text2_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then Text3.SetFocus
End Sub
Private Sub Text3_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then Command2.SetFocus
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -