www.pudn.com > DataCollectionSystem.rar > FrmChangePassword.frm, change:2003-10-15,size:12089b


VERSION 5.00 
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX" 
Begin VB.Form FrmChangePassword  
   BorderStyle     =   1  'Fixed Single 
   Caption         =   "修改密码" 
   ClientHeight    =   3015 
   ClientLeft      =   45 
   ClientTop       =   330 
   ClientWidth     =   5055 
   Icon            =   "FrmChangePassword.frx":0000 
   LinkTopic       =   "Form1" 
   MaxButton       =   0   'False 
   MinButton       =   0   'False 
   ScaleHeight     =   3015 
   ScaleWidth      =   5055 
   StartUpPosition =   1  '所有者中心 
   Begin MSComctlLib.ImageList ImgICO  
      Left            =   480 
      Top             =   2400 
      _ExtentX        =   1005 
      _ExtentY        =   1005 
      BackColor       =   -2147483643 
      ImageWidth      =   32 
      ImageHeight     =   32 
      MaskColor       =   12632256 
      _Version        =   393216 
      BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}  
         NumListImages   =   2 
         BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}  
            Picture         =   "FrmChangePassword.frx":030A 
            Key             =   "" 
         EndProperty 
         BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}  
            Picture         =   "FrmChangePassword.frx":0BE4 
            Key             =   "" 
         EndProperty 
      EndProperty 
   End 
   Begin 数据采集子系统.LaVolpeButton cmdCancel  
      Height          =   495 
      Left            =   1920 
      TabIndex        =   10 
      Top             =   2400 
      Width           =   1335 
      _ExtentX        =   2355 
      _ExtentY        =   873 
      BTYPE           =   3 
      TX              =   "取消(&C)" 
      ENAB            =   -1  'True 
      BeginProperty FONT {0BE35203-8F91-11CE-9DE3-00AA004BB851}  
         Name            =   "宋体" 
         Size            =   9 
         Charset         =   0 
         Weight          =   400 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      COLTYPE         =   1 
      BCOL            =   14215660 
      FCOL            =   0 
      FCOLO           =   0 
      EMBOSSM         =   12632256 
      EMBOSSS         =   16777215 
      MPTR            =   0 
      MICON           =   "FrmChangePassword.frx":14BE 
      ALIGN           =   0 
      IMGLST          =   "ImgICO" 
      IMGICON         =   "1" 
      ICONAlign       =   0 
      ORIENT          =   0 
      STYLE           =   0 
      IconSize        =   4 
      SHOWF           =   -1  'True 
      BSTYLE          =   0 
   End 
   Begin 数据采集子系统.LaVolpeButton cmdOK  
      Height          =   495 
      Left            =   3480 
      TabIndex        =   9 
      Top             =   2400 
      Width           =   1335 
      _ExtentX        =   2355 
      _ExtentY        =   873 
      BTYPE           =   3 
      TX              =   "确定(&O)" 
      ENAB            =   -1  'True 
      BeginProperty FONT {0BE35203-8F91-11CE-9DE3-00AA004BB851}  
         Name            =   "宋体" 
         Size            =   9 
         Charset         =   0 
         Weight          =   400 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      COLTYPE         =   1 
      BCOL            =   14215660 
      FCOL            =   0 
      FCOLO           =   0 
      EMBOSSM         =   12632256 
      EMBOSSS         =   16777215 
      MPTR            =   0 
      MICON           =   "FrmChangePassword.frx":14DA 
      ALIGN           =   0 
      IMGLST          =   "ImgICO" 
      IMGICON         =   "2" 
      ICONAlign       =   0 
      ORIENT          =   0 
      STYLE           =   0 
      IconSize        =   4 
      SHOWF           =   -1  'True 
      BSTYLE          =   0 
   End 
   Begin VB.Frame FrChangePassword  
      Caption         =   "修改密码" 
      ForeColor       =   &H00FF0000& 
      Height          =   2295 
      Left            =   240 
      TabIndex        =   3 
      Top             =   0 
      Width           =   4575 
      Begin VB.ComboBox cmbUser  
         BeginProperty Font  
            Name            =   "宋体" 
            Size            =   10.5 
            Charset         =   0 
            Weight          =   400 
            Underline       =   0   'False 
            Italic          =   0   'False 
            Strikethrough   =   0   'False 
         EndProperty 
         ForeColor       =   &H00FF0000& 
         Height          =   330 
         Left            =   1200 
         Style           =   2  'Dropdown List 
         TabIndex        =   8 
         Top             =   320 
         Width           =   3135 
      End 
      Begin VB.TextBox txtExistingPassword  
         BackColor       =   &H00FFFFFF& 
         BeginProperty Font  
            Name            =   "宋体" 
            Size            =   10.5 
            Charset         =   0 
            Weight          =   400 
            Underline       =   0   'False 
            Italic          =   0   'False 
            Strikethrough   =   0   'False 
         EndProperty 
         ForeColor       =   &H00FF0000& 
         Height          =   285 
         IMEMode         =   3  'DISABLE 
         Left            =   1200 
         PasswordChar    =   "*" 
         TabIndex        =   0 
         Top             =   840 
         Width           =   3135 
      End 
      Begin VB.TextBox txtNewPassword1  
         BackColor       =   &H00FFFFFF& 
         BeginProperty Font  
            Name            =   "宋体" 
            Size            =   10.5 
            Charset         =   0 
            Weight          =   400 
            Underline       =   0   'False 
            Italic          =   0   'False 
            Strikethrough   =   0   'False 
         EndProperty 
         ForeColor       =   &H00FF0000& 
         Height          =   285 
         IMEMode         =   3  'DISABLE 
         Left            =   1200 
         PasswordChar    =   "*" 
         TabIndex        =   1 
         Top             =   1320 
         Width           =   3135 
      End 
      Begin VB.TextBox txtNewPassword2  
         BackColor       =   &H00FFFFFF& 
         BeginProperty Font  
            Name            =   "宋体" 
            Size            =   10.5 
            Charset         =   0 
            Weight          =   400 
            Underline       =   0   'False 
            Italic          =   0   'False 
            Strikethrough   =   0   'False 
         EndProperty 
         ForeColor       =   &H00FF0000& 
         Height          =   285 
         IMEMode         =   3  'DISABLE 
         Left            =   1200 
         PasswordChar    =   "*" 
         TabIndex        =   2 
         Top             =   1800 
         Width           =   3135 
      End 
      Begin VB.Label Label4  
         AutoSize        =   -1  'True 
         Caption         =   "用 户 名:" 
         BeginProperty Font  
            Name            =   "宋体" 
            Size            =   9 
            Charset         =   0 
            Weight          =   400 
            Underline       =   0   'False 
            Italic          =   0   'False 
            Strikethrough   =   0   'False 
         EndProperty 
         Height          =   180 
         Left            =   240 
         TabIndex        =   7 
         Top             =   360 
         Width           =   900 
      End 
      Begin VB.Label Label1  
         AutoSize        =   -1  'True 
         Caption         =   "旧 密 码:" 
         BeginProperty Font  
            Name            =   "宋体" 
            Size            =   9 
            Charset         =   0 
            Weight          =   400 
            Underline       =   0   'False 
            Italic          =   0   'False 
            Strikethrough   =   0   'False 
         EndProperty 
         ForeColor       =   &H00000000& 
         Height          =   180 
         Left            =   240 
         TabIndex        =   6 
         Top             =   840 
         Width           =   900 
      End 
      Begin VB.Label Label2  
         AutoSize        =   -1  'True 
         Caption         =   "新 密 码:" 
         BeginProperty Font  
            Name            =   "宋体" 
            Size            =   9 
            Charset         =   0 
            Weight          =   400 
            Underline       =   0   'False 
            Italic          =   0   'False 
            Strikethrough   =   0   'False 
         EndProperty 
         ForeColor       =   &H00000000& 
         Height          =   180 
         Left            =   240 
         TabIndex        =   5 
         Top             =   1320 
         Width           =   900 
      End 
      Begin VB.Label Label3  
         AutoSize        =   -1  'True 
         Caption         =   "确认密码:" 
         BeginProperty Font  
            Name            =   "宋体" 
            Size            =   9 
            Charset         =   0 
            Weight          =   400 
            Underline       =   0   'False 
            Italic          =   0   'False 
            Strikethrough   =   0   'False 
         EndProperty 
         ForeColor       =   &H00000000& 
         Height          =   180 
         Left            =   240 
         TabIndex        =   4 
         Top             =   1800 
         Width           =   900 
      End 
   End 
End 
Attribute VB_Name = "FrmChangePassword" 
Attribute VB_GlobalNameSpace = False 
Attribute VB_Creatable = False 
Attribute VB_PredeclaredId = True 
Attribute VB_Exposed = False 
Option Explicit 
Private Declare Function ClassXP Lib "ClassXP.dll" (ByVal hwnd As Long, ByVal dwFlags As Long) As Long 
 
Dim cnn As New ADODB.Connection 
Dim rs As New ADODB.Recordset 
Dim rd As New ADODB.Recordset 
 
Private Sub cmdCancel_Click() 
     
    FrmChangePassword.Hide 
    Unload FrmChangePassword 
     
End Sub 
 
Private Sub cmdOK_Click() 
Dim sql As String 
 
sql = "Select ID,UserName,PassWord From 用户权限表 Where UserName =" & "'" & Trim(cmbUser.Text) & "'" 
rd.Open sql, cnn, adOpenStatic, adLockOptimistic 
 
If Trim(cmbUser.Text) = rd.Fields(1).Value And Trim(txtExistingPassword.Text) = rd.Fields(2).Value And Trim(txtNewPassword1.Text) = Trim(txtNewPassword2.Text) Then 
    rd.MoveFirst 
    rd.Fields(2).Value = Trim(txtNewPassword1.Text) 
    rd.Update 
    rd.Close 
    Set rd = Nothing 
    FrmChangePassword.Hide 
    Unload FrmChangePassword 
    MsgBox "修改密码成功!", vbOKOnly + 64, "提示" 
ElseIf Trim(txtExistingPassword.Text) = "" And Trim(txtExistingPassword.Text) <> rd.Fields(2).Value Then 
    MsgBox "初始密码不能为空!", vbOKOnly + 16, "警告" 
    rd.Close 
    Set rd = Nothing 
ElseIf Trim(txtExistingPassword.Text) <> rd.Fields(2).Value Then 
    MsgBox "初始密码不正确!", vbOKOnly + 16, "警告" 
    rd.Close 
    Set rd = Nothing 
ElseIf Trim(txtNewPassword1.Text) <> Trim(txtNewPassword2.Text) Then 
    MsgBox "两次输入的新密码不一致!", vbOKOnly + 16, "警告" 
    rd.Close 
    Set rd = Nothing 
End If 
 
End Sub 
 
Private Sub Form_Load() 
    Dim connStr As String, strSQL As String 
    ClassXP 0, 1 
    strSQL = "Select ID,UserName,PassWord From 用户权限表" 
    connStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\Profiles\sysdb.mdb" & ";Jet OLEDB:Database password=420111197709065755" 
    cnn.CursorLocation = adUseServer 
    cnn.ConnectionString = connStr 
    cnn.Open connStr 
    rs.Open strSQL, cnn, adOpenStatic, adLockOptimistic 
    rs.MoveFirst 
    Do While Not rs.EOF 
        cmbUser.AddItem rs.Fields(1).Value, rs.Fields(0).Value - 1 
    rs.MoveNext 
    Loop 
    cmbUser.ListIndex = 0 
End Sub 
 
Private Sub Form_Unload(Cancel As Integer) 
    ClassXP 0, 0 
    rs.Close 
    cnn.Close 
    Set rs = Nothing 
    Set cnn = Nothing 
End Sub