⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 changepassword.frm

📁 使用vb来编制仓库管理方面的绝佳例子
💻 FRM
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form ChangePassword 
   BorderStyle     =   3  'Fixed Dialog
   ClientHeight    =   3975
   ClientLeft      =   45
   ClientTop       =   435
   ClientWidth     =   6195
   Icon            =   "ChangePassword.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MDIChild        =   -1  'True
   MinButton       =   0   'False
   ScaleHeight     =   3975
   ScaleWidth      =   6195
   ShowInTaskbar   =   0   'False
   Begin VB.CommandButton cmdRET 
      Caption         =   "返回(&R)"
      Height          =   735
      Left            =   3480
      TabIndex        =   4
      Top             =   2880
      Width           =   1335
   End
   Begin VB.CommandButton cmdOK 
      Cancel          =   -1  'True
      Caption         =   "确定(&O)"
      Default         =   -1  'True
      Enabled         =   0   'False
      Height          =   735
      Left            =   1440
      TabIndex        =   3
      Top             =   2880
      Width           =   1335
   End
   Begin VB.Frame Frame1 
      Height          =   2055
      Left            =   720
      TabIndex        =   5
      Top             =   480
      Width           =   4815
      Begin VB.TextBox Text1 
         Appearance      =   0  'Flat
         BackColor       =   &H00FFC0C0&
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   300
         IMEMode         =   3  'DISABLE
         Index           =   2
         Left            =   1680
         MaxLength       =   12
         PasswordChar    =   "*"
         TabIndex        =   2
         Top             =   1440
         Width           =   2535
      End
      Begin VB.TextBox Text1 
         Appearance      =   0  'Flat
         BackColor       =   &H00FFC0C0&
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   300
         IMEMode         =   3  'DISABLE
         Index           =   1
         Left            =   1680
         MaxLength       =   12
         PasswordChar    =   "*"
         TabIndex        =   1
         Top             =   960
         Width           =   2535
      End
      Begin VB.TextBox Text1 
         Appearance      =   0  'Flat
         BackColor       =   &H00FFC0C0&
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   300
         IMEMode         =   3  'DISABLE
         Index           =   0
         Left            =   1680
         MaxLength       =   12
         PasswordChar    =   "*"
         TabIndex        =   0
         Top             =   450
         Width           =   2535
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         Caption         =   "新密码:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   240
         Index           =   2
         Left            =   600
         TabIndex        =   8
         Top             =   960
         Width           =   840
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         Caption         =   "  确认:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   240
         Index           =   1
         Left            =   600
         TabIndex        =   7
         Top             =   1440
         Width           =   840
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         Caption         =   "旧密码:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   240
         Index           =   0
         Left            =   600
         TabIndex        =   6
         Top             =   480
         Width           =   840
      End
   End
   Begin MSAdodcLib.Adodc operater 
      Height          =   330
      Left            =   840
      Top             =   4680
      Width           =   4575
      _ExtentX        =   8070
      _ExtentY        =   582
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   8
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   1
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   ""
      OLEDBString     =   ""
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   ""
      Caption         =   "操作员"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _Version        =   393216
   End
End
Attribute VB_Name = "ChangePassword"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub CmdOK_Click()         '修改密码
  If Trim(Text1(0)) <> Password Then
      MsgBox "旧密码输入有误码!!!"
      Text1(0).SetFocus
      Exit Sub
  End If
  If Trim(Text1(1)) <> Trim(Text1(2)) Then
    MsgBox "新密码和确认密码不相同"
    Text1(1) = ""
    Text1(2) = ""
    Text1(1).SetFocus
  Else
    operater.RecordSource = "select * from operater where 姓名='" & Operater1 & "'"
    operater.Refresh
    operater.Recordset.Fields(1) = Trim(Text1(1))
    operater.Recordset.Update
    operater.Refresh
    Password = Trim(Text1(1))
    Text1(0) = ""
    Text1(1) = ""
    Text1(2) = ""
    MsgBox "修改成功!!!"
    Text1(0).SetFocus
  End If
End Sub

Private Sub cmdRet_Click()      '返回
  Unload ChangePassword
End Sub

Private Sub Form_Load()         '初始化
  Me.Top = (Mainform.Height - Me.Height) / 2 - 1500
  Me.Left = (Mainform.Width - Me.Width) / 2
  Me.Caption = "仓库管理系统→" & "个人密码设置"
  operater.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Storehouse.mdb;Persist Security Info=False"
End Sub

Private Sub Text1_Change(Index As Integer)
  If Trim(Text1(0)) = "" Or Trim(Text1(1)) = "" Or Trim(Text1(2)) = "" Then
    cmdOK.Enabled = False
  Else
    cmdOK.Enabled = True
  End If
End Sub

Private Sub Text1_GotFocus(Index As Integer)
  Text1(Index).BackColor = &HC0FFFF
  Text1(Index).SelStart = 0
  Text1(Index).SelLength = 12
End Sub

Private Sub Text1_LostFocus(Index As Integer)
  Text1(Index).BackColor = &HFFC0C0
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -