main_xtgl_mm.frm
上传用户:wd52qq
上传日期:2022-07-24
资源大小:5366k
文件大小:5k
源码类别:

企业管理

开发平台:

Visual Basic

  1. VERSION 5.00
  2. Begin VB.Form main_xtgl_mm 
  3.    BorderStyle     =   3  'Fixed Dialog
  4.    Caption         =   "密码修改"
  5.    ClientHeight    =   3045
  6.    ClientLeft      =   2715
  7.    ClientTop       =   3690
  8.    ClientWidth     =   5505
  9.    Icon            =   "main_xtgl_mm.frx":0000
  10.    LinkTopic       =   "Form1"
  11.    MaxButton       =   0   'False
  12.    MinButton       =   0   'False
  13.    ScaleHeight     =   3045
  14.    ScaleWidth      =   5505
  15.    ShowInTaskbar   =   0   'False
  16.    StartUpPosition =   1  '所有者中心
  17.    Tag             =   "修改密码"
  18.    Begin VB.CommandButton Command2 
  19.       Caption         =   "取消"
  20.       Height          =   390
  21.       Left            =   2850
  22.       Picture         =   "main_xtgl_mm.frx":000C
  23.       TabIndex        =   2
  24.       TabStop         =   0   'False
  25.       Top             =   2565
  26.       Width           =   1575
  27.    End
  28.    Begin VB.CommandButton Command1 
  29.       Caption         =   "确定"
  30.       Height          =   390
  31.       Left            =   1095
  32.       Picture         =   "main_xtgl_mm.frx":19C6
  33.       TabIndex        =   1
  34.       Top             =   2565
  35.       Width           =   1575
  36.    End
  37.    Begin VB.Frame Frame1 
  38.       Height          =   2535
  39.       Left            =   30
  40.       TabIndex        =   3
  41.       Top             =   -60
  42.       Width           =   5445
  43.       Begin VB.TextBox Text1 
  44.          BackColor       =   &H00FFFFFF&
  45.          Height          =   315
  46.          Index           =   2
  47.          Left            =   1500
  48.          TabIndex        =   7
  49.          Top             =   1860
  50.          Width           =   2880
  51.       End
  52.       Begin VB.TextBox Text1 
  53.          BackColor       =   &H00FFFFFF&
  54.          Height          =   315
  55.          Index           =   1
  56.          Left            =   1500
  57.          TabIndex        =   6
  58.          Top             =   1305
  59.          Width           =   2880
  60.       End
  61.       Begin VB.TextBox Text1 
  62.          BackColor       =   &H00FFFFFF&
  63.          Height          =   315
  64.          Index           =   0
  65.          Left            =   1500
  66.          Locked          =   -1  'True
  67.          TabIndex        =   0
  68.          Top             =   765
  69.          Width           =   2880
  70.       End
  71.       Begin VB.Label Label1 
  72.          BackStyle       =   0  'Transparent
  73.          Caption         =   "请输入操作员、原密码及新密码"
  74.          ForeColor       =   &H000000FF&
  75.          Height          =   225
  76.          Left            =   180
  77.          TabIndex        =   5
  78.          Top             =   315
  79.          Width           =   4290
  80.       End
  81.       Begin VB.Label Label2 
  82.          BackStyle       =   0  'Transparent
  83.          Caption         =   "操作员                原密码                  新密码"
  84.          Height          =   1365
  85.          Left            =   795
  86.          TabIndex        =   4
  87.          Top             =   825
  88.          Width           =   690
  89.       End
  90.    End
  91. End
  92. Attribute VB_Name = "main_xtgl_mm"
  93. Attribute VB_GlobalNameSpace = False
  94. Attribute VB_Creatable = False
  95. Attribute VB_PredeclaredId = True
  96. Attribute VB_Exposed = False
  97. Private Sub Form_Load()
  98.   If main_xtgl_czqx.Visible = True Then
  99.      Text1(0) = main_xtgl_czqx.DataList1.BoundText
  100.   Else
  101.      Text1(0) = czy
  102.   End If
  103. End Sub
  104. Private Sub Text1_GotFocus(index As Integer)
  105.   Text1(index).BackColor = &HFFFF80
  106.   Text1(index).SelStart = 0
  107.   Text1(index).SelLength = Len(Text1(index))
  108. End Sub
  109. Private Sub Text1_LostFocus(index As Integer)
  110.   Text1(index).BackColor = &HFFFFFF
  111. End Sub
  112. Private Sub Text1_KeyDown(index As Integer, KeyCode As Integer, Shift As Integer)
  113.   If KeyCode = vbKeyReturn And index < 2 Then Text1(index + 1).SetFocus
  114.   If KeyCode = vbKeyReturn And index = 2 Then Command1.SetFocus
  115.   If KeyCode = vbKeyUp And index > 0 Then Text1(index - 1).SetFocus
  116. End Sub
  117. Private Sub Command1_Click()     '确认修改操作员信息
  118.   Dim rs1 As New ADODB.Recordset
  119.   If Len(Text1(0)) = 0 Then
  120.      MsgBox "请输入操作员!", , "提示窗口"
  121.      Exit Sub
  122.   End If
  123.   If Len(Text1(1)) = 0 Then
  124.      MsgBox "请输入原密码!", , "提示窗口"
  125.      Exit Sub
  126.   End If
  127.   On Error GoTo SaveErr
  128.   rs1.Open "权限信息表 where 操作员='" + Text1(0).text + "'", Cnn, adOpenStatic
  129.   If rs1.RecordCount > 0 Then
  130.      If Text1(1) <> rs1.Fields("密码") Then
  131.         MsgBox "原密码不正确!", , "提示窗口"
  132.         Text1(1).SetFocus
  133.      Else
  134.         If Len(Text1(2)) = 0 Then
  135.            MsgBox "请输入新密码!", , "提示窗口"
  136.            Text1(2).SetFocus
  137.         Else
  138.            Cnn.Execute ("update 权限信息表 set 密码='" + Text1(2) + "'where 操作员='" + Text1(0).text + "'")
  139.            MsgBox "密码修改成功!", , "提示窗口"
  140.            Command2_Click
  141.         End If
  142.      End If
  143.   Else
  144.      MsgBox "操作员不正确!", , "提示窗口"
  145.      Text1(0).SetFocus
  146.   End If
  147.   Exit Sub
  148. SaveErr:
  149.        MsgBox Err.Description
  150. End Sub
  151. Private Sub Command2_Click()
  152.   Unload Me
  153. End Sub