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

📄 main密码修改.frm

📁 1. 观察计算机显示系统构成
💻 FRM
字号:
VERSION 5.00
Begin VB.Form main密码修改 
   Caption         =   "密码修改"
   ClientHeight    =   2775
   ClientLeft      =   60
   ClientTop       =   405
   ClientWidth     =   3630
   LinkTopic       =   "Form2"
   ScaleHeight     =   2775
   ScaleWidth      =   3630
   StartUpPosition =   3  '窗口缺省
   Begin VB.CommandButton Command1 
      BackColor       =   &H00FF8080&
      Caption         =   "确定"
      Height          =   405
      Left            =   120
      TabIndex        =   7
      Top             =   2265
      Width           =   1575
   End
   Begin VB.TextBox Text1 
      BackColor       =   &H00FFC0C0&
      Height          =   300
      IMEMode         =   3  'DISABLE
      Left            =   960
      TabIndex        =   6
      Top             =   750
      Width           =   2340
   End
   Begin VB.TextBox Text2 
      BackColor       =   &H00FFC0C0&
      Height          =   300
      IMEMode         =   3  'DISABLE
      Left            =   960
      PasswordChar    =   "*"
      TabIndex        =   5
      Top             =   1200
      Width           =   2340
   End
   Begin VB.TextBox Text3 
      BackColor       =   &H00FFC0C0&
      Height          =   300
      IMEMode         =   3  'DISABLE
      Left            =   960
      PasswordChar    =   "*"
      TabIndex        =   4
      Top             =   1575
      Width           =   2340
   End
   Begin VB.CommandButton Command2 
      BackColor       =   &H00FF8080&
      Caption         =   "退出"
      Height          =   405
      Left            =   1800
      TabIndex        =   3
      Top             =   2265
      Width           =   1575
   End
   Begin VB.Frame Frame1 
      Caption         =   "Frame1"
      Height          =   1320
      Left            =   1080
      TabIndex        =   0
      Top             =   2790
      Visible         =   0   'False
      Width           =   1425
      Begin VB.TextBox ma 
         DataField       =   "密码"
         DataSource      =   "Data1"
         Height          =   270
         Left            =   75
         TabIndex        =   2
         Top             =   480
         Width           =   1140
      End
      Begin VB.TextBox czy 
         DataField       =   "用户名称"
         DataSource      =   "Data1"
         Height          =   270
         Left            =   75
         TabIndex        =   1
         Top             =   195
         Width           =   1140
      End
      Begin VB.Data Data1 
         Caption         =   "Data1"
         Connect         =   "Access"
         DatabaseName    =   "D:\桌面\新建文件夹\db2.mdb"
         DefaultCursorType=   0  '缺省游标
         DefaultType     =   2  '使用 ODBC
         Exclusive       =   0   'False
         Height          =   345
         Left            =   195
         Options         =   0
         ReadOnly        =   0   'False
         RecordsetType   =   1  'Dynaset
         RecordSource    =   "用户管理表"
         Top             =   855
         Visible         =   0   'False
         Width           =   1140
      End
   End
   Begin VB.Label Label1 
      BackStyle       =   0  'Transparent
      Caption         =   "请输入操作员代号、原密码和新密码"
      Height          =   360
      Left            =   255
      TabIndex        =   11
      Top             =   240
      Width           =   2985
   End
   Begin VB.Label Label2 
      BackStyle       =   0  'Transparent
      Caption         =   "用户名"
      Height          =   255
      Left            =   120
      TabIndex        =   10
      Top             =   810
      Width           =   645
   End
   Begin VB.Label Label3 
      BackStyle       =   0  'Transparent
      Caption         =   "源密码"
      Height          =   255
      Left            =   120
      TabIndex        =   9
      Top             =   1230
      Width           =   735
   End
   Begin VB.Label Label4 
      BackStyle       =   0  'Transparent
      Caption         =   "新密码"
      Height          =   255
      Left            =   120
      TabIndex        =   8
      Top             =   1665
      Width           =   735
   End
End
Attribute VB_Name = "main密码修改"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Form_Load()
 frm主窗体.StatusBar1.Panels(1) = Me.Caption
 Data1.DatabaseName = App.Path & "\db2.mdb"
End Sub
Private Sub Form_Unload(Cancel As Integer)
 frm主窗体.Enabled = True
 frm主窗体.StatusBar1.Panels(1) = "杨扬工作室 作者:小杨"
End Sub

Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
  If KeyCode = vbKeyReturn Then
     Text2.SetFocus
  End If
  If KeyCode = vbKeyDown Then
     Data1.RecordSource = "select * from 用户管理表 where (用户管理表.用户名称 like '%" + Text1.Text + "%')"
     Data1.Refresh
     Text2.SetFocus
  End If
End Sub
Private Sub Text2_KeyDown(KeyCode As Integer, Shift As Integer)
  If KeyCode = vbKeyReturn Then
     Text3.SetFocus
  End If
  If KeyCode = vbKeyUp Then
     Text1.SetFocus
  End If
  If KeyCode = vbKeyDown Then
     Data1.RecordSource = "select * from 用户管理表 where (用户管理表.密码  like '%" + Text2.Text + "%')"
     Data1.Refresh
     Text3.SetFocus
  End If
End Sub
Private Sub Text3_KeyDown(KeyCode As Integer, Shift As Integer)
  If KeyCode = vbKeyReturn Then
     Command1.SetFocus
  End If
  If KeyCode = vbKeyUp Then
     Text2.SetFocus
  End If
  If KeyCode = vbKeyDown Then
     Command1.SetFocus
  End If
End Sub
Private Sub Command1_Click()
Call main
  Dim MESSAGE As String
  Data1.RecordSource = "select * from 用户管理表 where (用户管理表.用户名称='" + Text1.Text + "' and 用户管理表.密码='" + Text2.Text + "')"
  Data1.Refresh
   If Data1.Recordset.RecordCount > 0 Then
      Set adoRs = adoCon.Execute("update 用户管理表 set 密码='" + Text3.Text + "' where 用户名称='" + Text1.Text + "'")
      MsgBox "密码修改成功!", , "信息提示"
   Else
      MsgBox "没有要修改的相关信息!", , "信息提示"
   End If
 adoCon.Close
End Sub
Private Sub Command2_Click()
  frm主窗体.Enabled = True
  Unload Me
End Sub

⌨️ 快捷键说明

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