main_xtgl_mm.frm
上传用户:wd52qq
上传日期:2022-07-24
资源大小:5366k
文件大小:5k
- VERSION 5.00
- Begin VB.Form main_xtgl_mm
- BorderStyle = 3 'Fixed Dialog
- Caption = "密码修改"
- ClientHeight = 3045
- ClientLeft = 2715
- ClientTop = 3690
- ClientWidth = 5505
- Icon = "main_xtgl_mm.frx":0000
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 3045
- ScaleWidth = 5505
- ShowInTaskbar = 0 'False
- StartUpPosition = 1 '所有者中心
- Tag = "修改密码"
- Begin VB.CommandButton Command2
- Caption = "取消"
- Height = 390
- Left = 2850
- Picture = "main_xtgl_mm.frx":000C
- TabIndex = 2
- TabStop = 0 'False
- Top = 2565
- Width = 1575
- End
- Begin VB.CommandButton Command1
- Caption = "确定"
- Height = 390
- Left = 1095
- Picture = "main_xtgl_mm.frx":19C6
- TabIndex = 1
- Top = 2565
- Width = 1575
- End
- Begin VB.Frame Frame1
- Height = 2535
- Left = 30
- TabIndex = 3
- Top = -60
- Width = 5445
- Begin VB.TextBox Text1
- BackColor = &H00FFFFFF&
- Height = 315
- Index = 2
- Left = 1500
- TabIndex = 7
- Top = 1860
- Width = 2880
- End
- Begin VB.TextBox Text1
- BackColor = &H00FFFFFF&
- Height = 315
- Index = 1
- Left = 1500
- TabIndex = 6
- Top = 1305
- Width = 2880
- End
- Begin VB.TextBox Text1
- BackColor = &H00FFFFFF&
- Height = 315
- Index = 0
- Left = 1500
- Locked = -1 'True
- TabIndex = 0
- 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 = 795
- TabIndex = 4
- Top = 825
- Width = 690
- End
- End
- End
- Attribute VB_Name = "main_xtgl_mm"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Private Sub Form_Load()
- If main_xtgl_czqx.Visible = True Then
- Text1(0) = main_xtgl_czqx.DataList1.BoundText
- Else
- Text1(0) = czy
- End If
- 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
- On Error GoTo SaveErr
- rs1.Open "权限信息表 where 操作员='" + Text1(0).text + "'", Cnn, adOpenStatic
- If rs1.RecordCount > 0 Then
- If Text1(1) <> rs1.Fields("密码") Then
- MsgBox "原密码不正确!", , "提示窗口"
- Text1(1).SetFocus
- Else
- If Len(Text1(2)) = 0 Then
- MsgBox "请输入新密码!", , "提示窗口"
- Text1(2).SetFocus
- Else
- Cnn.Execute ("update 权限信息表 set 密码='" + Text1(2) + "'where 操作员='" + Text1(0).text + "'")
- MsgBox "密码修改成功!", , "提示窗口"
- Command2_Click
- End If
- End If
- Else
- MsgBox "操作员不正确!", , "提示窗口"
- Text1(0).SetFocus
- End If
- Exit Sub
- SaveErr:
- MsgBox Err.Description
- End Sub
- Private Sub Command2_Click()
- Unload Me
- End Sub