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

📄 form1.frm

📁 本系统用于大学学生宿舍管理
💻 FRM
字号:
VERSION 5.00
Begin VB.Form changeform 
   BorderStyle     =   0  'None
   Caption         =   "Form1"
   ClientHeight    =   4605
   ClientLeft      =   2835
   ClientTop       =   1755
   ClientWidth     =   6615
   LinkTopic       =   "Form1"
   MDIChild        =   -1  'True
   ScaleHeight     =   4605
   ScaleWidth      =   6615
   ShowInTaskbar   =   0   'False
   Begin VB.CommandButton Command2 
      Caption         =   "取消"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   14.25
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   735
      Left            =   3720
      TabIndex        =   7
      Top             =   3720
      Width           =   2415
   End
   Begin VB.CommandButton Command1 
      Caption         =   "确定"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   14.25
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   735
      Left            =   240
      TabIndex        =   6
      Top             =   3720
      Width           =   2655
   End
   Begin VB.TextBox renewtxt 
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   14.25
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   735
      Left            =   3000
      TabIndex        =   5
      Top             =   2280
      Width           =   2895
   End
   Begin VB.TextBox newtxt 
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   14.25
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   735
      Left            =   3000
      TabIndex        =   3
      Top             =   1320
      Width           =   2895
   End
   Begin VB.TextBox oldtxt 
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   14.25
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   615
      Left            =   3000
      TabIndex        =   1
      Top             =   360
      Width           =   2895
   End
   Begin VB.Label Label3 
      Caption         =   "确认新密码"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   14.25
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   735
      Left            =   0
      TabIndex        =   4
      Top             =   2400
      Width           =   2775
   End
   Begin VB.Label Label2 
      Caption         =   "请输入新密码"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   14.25
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   735
      Left            =   0
      TabIndex        =   2
      Top             =   1320
      Width           =   2655
   End
   Begin VB.Label Label1 
      Caption         =   "请输入旧密码"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   14.25
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   615
      Left            =   0
      TabIndex        =   0
      Top             =   360
      Width           =   2655
   End
End
Attribute VB_Name = "changeform"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim change As Boolean
Dim sqlstr As String
Dim idinfo As Recordset

If oldtxt <> "" And newtxt = renewtxt Then
change = True
Else
MsgBox "请确认输入的新密码是否一致 ", vbOKOnly, "修改出错密码"

oldtxt = ""
newtxt = ""
renewtxt = ""
oldtxt.SetFocus
End If
If change Then
sqlstr = "select id,pw from mmb where id='" & yhid & "'"
Set idinfo = db.OpenRecordset(sqlstr, dbOpenDynaset)
If (idinfo.Fields("pw").Value = oldtxt) Then
With idinfo
.Edit
!pw = newtxt
.Update
.Bookmark = .LastModified
End With
MsgBox "密码修改成功", , "成功"
Unload Me
Else
MsgBox "密码错误,请重试", vbOKOnly, "修改密码出错"
oldtxt = ""
newtxt = ""
renewtxt = ""
oldtxt.SetFocus
End If
idinfo.Close
End If

End Sub

Private Sub Command2_Click()
Unload Me

End Sub

⌨️ 快捷键说明

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