www.pudn.com > zytgzgl.rar > Form1.frm, change:2004-06-09,size:6186b


VERSION 5.00 
Begin VB.Form frmchangepwd  
   Caption         =   "修改密码" 
   ClientHeight    =   4815 
   ClientLeft      =   60 
   ClientTop       =   450 
   ClientWidth     =   5805 
   LinkTopic       =   "Form1" 
   MaxButton       =   0   'False 
   MinButton       =   0   'False 
   ScaleHeight     =   4815 
   ScaleWidth      =   5805 
   StartUpPosition =   2  '屏幕中心 
   Begin VB.CommandButton cmdcancel  
      Caption         =   "取 消" 
      BeginProperty Font  
         Name            =   "楷体_GB2312" 
         Size            =   12 
         Charset         =   134 
         Weight          =   700 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      Height          =   495 
      Left            =   3240 
      TabIndex        =   7 
      Top             =   3720 
      Width           =   1215 
   End 
   Begin VB.CommandButton cmdok  
      Caption         =   "确 定" 
      BeginProperty Font  
         Name            =   "楷体_GB2312" 
         Size            =   12 
         Charset         =   134 
         Weight          =   700 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      Height          =   495 
      Left            =   960 
      TabIndex        =   6 
      Top             =   3720 
      Width           =   1215 
   End 
   Begin VB.TextBox confirmpwd  
      BeginProperty Font  
         Name            =   "宋体" 
         Size            =   12 
         Charset         =   134 
         Weight          =   700 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      Height          =   495 
      IMEMode         =   3  'DISABLE 
      Left            =   3000 
      MaxLength       =   8 
      PasswordChar    =   "*" 
      TabIndex        =   5 
      Top             =   2520 
      Width           =   1695 
   End 
   Begin VB.TextBox newpwd  
      BeginProperty Font  
         Name            =   "宋体" 
         Size            =   12 
         Charset         =   134 
         Weight          =   700 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      Height          =   495 
      IMEMode         =   3  'DISABLE 
      Left            =   3000 
      MaxLength       =   8 
      PasswordChar    =   "*" 
      TabIndex        =   4 
      Top             =   1680 
      Width           =   1695 
   End 
   Begin VB.TextBox oldpwd  
      BeginProperty Font  
         Name            =   "宋体" 
         Size            =   12 
         Charset         =   134 
         Weight          =   700 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      Height          =   495 
      IMEMode         =   3  'DISABLE 
      Left            =   3000 
      PasswordChar    =   "*" 
      TabIndex        =   3 
      Top             =   840 
      Width           =   1695 
   End 
   Begin VB.Label Label3  
      Caption         =   "请确认新密码" 
      BeginProperty Font  
         Name            =   "楷体_GB2312" 
         Size            =   12 
         Charset         =   134 
         Weight          =   700 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      Height          =   495 
      Left            =   960 
      TabIndex        =   2 
      Top             =   2640 
      Width           =   1575 
   End 
   Begin VB.Label Label2  
      Caption         =   "请输入新密码" 
      BeginProperty Font  
         Name            =   "楷体_GB2312" 
         Size            =   12 
         Charset         =   134 
         Weight          =   700 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      Height          =   495 
      Left            =   960 
      TabIndex        =   1 
      Top             =   1800 
      Width           =   1575 
   End 
   Begin VB.Label Label1  
      Caption         =   "请输入旧密码" 
      BeginProperty Font  
         Name            =   "楷体_GB2312" 
         Size            =   12 
         Charset         =   134 
         Weight          =   700 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      Height          =   495 
      Left            =   960 
      TabIndex        =   0 
      Top             =   960 
      Width           =   1575 
   End 
End 
Attribute VB_Name = "frmchangepwd" 
Attribute VB_GlobalNameSpace = False 
Attribute VB_Creatable = False 
Attribute VB_PredeclaredId = True 
Attribute VB_Exposed = False 
Private Sub cmdcancel_Click() 
  Unload Me 
  Exit Sub 
End Sub 
Private Sub cmdok_Click() 
  Dim sql As String 
  Dim rs As ADODB.Recordset 
  If Trim(oldpwd.Text) = "" Then 
    MsgBox "请输入旧密码", vbOKOnly + vbExclamation, "提示" 
    oldpwd.SetFocus 
    Exit Sub 
  Else 
     If Trim(oldpwd.Text) <> Trim(userpassword) Then 
       MsgBox "旧密码与登录的密码不同,请重新输入!", vbOKOnly + vbExclamation, "提示" 
       oldpwd.Text = "" 
       oldpwd.SetFocus 
     ElseIf Trim(newpwd.Text) = "" Then 
       MsgBox "请输入新密码", vbOKOnly + vbExclamation, "提示" 
       newpwd.SetFocus 
       Exit Sub 
     ElseIf Trim(newpwd.Text) <> Trim(confirmpwd.Text) Then 
       MsgBox "两次密码不同", vbOKOnly + vbExclamation, "警告" 
       newpwd.Text = "" 
       confirmpwd.Text = "" 
       newpwd.SetFocus 
     Else 
       userpassword = newpwd 
       sql = "update userinfo set userpwd='" & newpwd & "'where userid='" & strusername & "'" 
       Call transactsql(sql, "salary") 
       MsgBox "密码已经修改", vbOKOnly + vbExclamation, "修改结果" 
       Unload Me 
    End If 
  End If 
End Sub