main_xtgl_czy.frm
上传用户:ake0106
上传日期:2022-07-23
资源大小:4052k
文件大小:5k
- VERSION 5.00
- Begin VB.Form main_xtgl_czy
- BorderStyle = 3 'Fixed Dialog
- Caption = "操作员设置"
- ClientHeight = 3045
- ClientLeft = 2715
- ClientTop = 3690
- ClientWidth = 5940
- Icon = "main_xtgl_czy.frx":0000
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 3045
- ScaleWidth = 5940
- ShowInTaskbar = 0 'False
- StartUpPosition = 1 '所有者中心
- Begin VB.CommandButton Command2
- Caption = "取消"
- Height = 390
- Left = 3150
- Picture = "main_xtgl_czy.frx":000C
- TabIndex = 1
- Top = 2565
- Width = 1575
- End
- Begin VB.CommandButton Command1
- Caption = "确定"
- Height = 390
- Left = 1395
- Picture = "main_xtgl_czy.frx":19C6
- TabIndex = 0
- Tag = "设置操作员"
- Top = 2565
- Width = 1575
- End
- Begin VB.Frame Frame1
- Height = 2535
- Left = 30
- TabIndex = 2
- Top = -60
- Width = 5895
- Begin VB.TextBox Text1
- BackColor = &H00FFFFFF&
- Height = 315
- Index = 2
- Left = 1800
- TabIndex = 7
- Top = 1845
- Width = 2880
- End
- Begin VB.TextBox Text1
- BackColor = &H00FFFFFF&
- Height = 315
- IMEMode = 3 'DISABLE
- Index = 1
- Left = 1800
- PasswordChar = "*"
- TabIndex = 6
- Top = 1305
- Width = 2880
- End
- Begin VB.TextBox Text1
- BackColor = &H00FFFFFF&
- Height = 315
- Index = 0
- Left = 1800
- TabIndex = 3
- Top = 765
- Width = 2880
- End
- Begin VB.Label Label1
- BackStyle = 0 'Transparent
- Caption = "请输入操作员及密码"
- ForeColor = &H000000FF&
- Height = 225
- Left = 180
- TabIndex = 5
- Top = 315
- Width = 4290
- End
- Begin VB.Label Label2
- BackStyle = 0 'Transparent
- Caption = "操作员 密 码 确认密码"
- Height = 1365
- Left = 945
- TabIndex = 4
- Top = 840
- Width = 765
- End
- End
- End
- Attribute VB_Name = "main_xtgl_czy"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Private Sub Form_Activate()
- Text1(0).SetFocus
- End Sub
- Private Sub Text1_GotFocus(index As Integer)
- Text1(index).BackColor = &HFFFF80
- Text1(index).SelStart = 0
- Text1(index).SelLength = Len(Text1(index))
- End Sub
- Private Sub Text1_LostFocus(index As Integer)
- Text1(index).BackColor = &HFFFFFF
- End Sub
- Private Sub Text1_KeyDown(index As Integer, KeyCode As Integer, Shift As Integer)
- If KeyCode = vbKeyReturn And index < 2 Then Text1(index + 1).SetFocus
- If KeyCode = vbKeyReturn And index = 2 Then Command1.SetFocus
- If KeyCode = vbKeyUp And index > 0 Then Text1(index - 1).SetFocus
- End Sub
- Private Sub Command1_Click() '确认修改操作员信息
- Dim rs1 As New ADODB.Recordset
- If Len(Text1(0)) = 0 Then
- MsgBox "请输入操作员!", , "提示窗口"
- Exit Sub
- End If
- If Len(Text1(1)) = 0 Then
- MsgBox "请输入密码!", , "提示窗口"
- Exit Sub
- End If
- If Len(Text1(2)) = 0 Then
- MsgBox "请输入确认密码!", , "提示窗口"
- Exit Sub
- End If
- If Text1(1) <> Text1(2) Then
- MsgBox "输入的密码与确认密码不一致!", , "提示窗口"
- Exit Sub
- End If
- On Error GoTo SaveErr
- rs1.Open "权限信息表", Cnn, adOpenKeyset, adLockOptimistic '查询操作员信息
- rs1.AddNew
- rs1.Fields("操作员") = Text1(0)
- rs1.Fields("密码") = Text1(1)
- rs1.Update
- main_xtgl_czqx.ado1.Refresh
- Unload Me
- Exit Sub
- SaveErr:
- MsgBox Err.Description
- End Sub
- Private Sub Command2_Click()
- Unload Me
- End Sub