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

📄 updatepwd.frm

📁 实现图书信息管理
💻 FRM
字号:
VERSION 5.00
Begin VB.Form updatepwd 
   Caption         =   "修改密码"
   ClientHeight    =   3930
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   4905
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   ScaleHeight     =   3930
   ScaleWidth      =   4905
   StartUpPosition =   3  '窗口缺省
   Begin VB.CommandButton Command2 
      Caption         =   "取消"
      Height          =   495
      Left            =   2280
      TabIndex        =   6
      Top             =   3000
      Width           =   1215
   End
   Begin VB.CommandButton Command1 
      Caption         =   "确定"
      Height          =   495
      Left            =   360
      TabIndex        =   4
      Top             =   3000
      Width           =   1335
   End
   Begin VB.TextBox Text2 
      Height          =   375
      IMEMode         =   3  'DISABLE
      Left            =   1440
      PasswordChar    =   "*"
      TabIndex        =   3
      Top             =   1440
      Width           =   2175
   End
   Begin VB.TextBox Text1 
      Height          =   375
      IMEMode         =   3  'DISABLE
      Left            =   1440
      PasswordChar    =   "*"
      TabIndex        =   1
      Top             =   240
      Width           =   2175
   End
   Begin VB.Label Label3 
      Caption         =   "(注意:输入的字符数必须是1-20个)"
      ForeColor       =   &H000000FF&
      Height          =   375
      Left            =   120
      TabIndex        =   5
      Top             =   2280
      Width           =   4575
   End
   Begin VB.Label Label2 
      Caption         =   "确认密码:"
      Height          =   255
      Left            =   120
      TabIndex        =   2
      Top             =   1560
      Width           =   975
   End
   Begin VB.Label Label1 
      Caption         =   "请输入新密码:"
      Height          =   255
      Left            =   120
      TabIndex        =   0
      Top             =   360
      Width           =   1335
   End
End
Attribute VB_Name = "updatepwd"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim response

Private Sub Command1_Click()
If Trim(Text1.Text) = "" Or Len(Trim(Text1.Text)) > 20 Then
response = MsgBox("请按要求填入完整的信息", vbOKOnly + vbExclamation, "注意")
Else
If updatepwd.Caption = "修改密码" Then
    If Trim(Text1.Text) <> Trim(Text2.Text) Then
    response = MsgBox("前后密码输入不同", vbOKOnly + vbExclamation, "注意")
    Else
    cmd.CommandText = "exec user_update " & "'" & Trim(Text2.Text) & "'"
    cmd.Execute
    Unload Me
    response = MsgBox("修改成功", vbOKOnly + vbExclamation, "恭喜您")
    End If
End If

If updatepwd.Caption = "添加用户" Then
If Trim(Text2.Text) = "" Or Len(Trim(Text2.Text)) > 20 Then
response = MsgBox("请按要求填入完整的信息", vbOKOnly + vbExclamation, "注意")
Else
    cmd.CommandText = "select * from Users where 用户名=" & "'" & Trim(Text1.Text) & "'"
    Set rs = cmd.Execute
    If rs.EOF Then
    cmd.CommandText = "exec user_insert " & "'" & Trim(Text1.Text) & "'" & "," & "'" & _
                      Trim(Text2.Text) & "'"
    response = MsgBox("添加成功", vbOKOnly + vbExclamation, "恭喜您")
    cmd.Execute
    Else
    response = MsgBox("用户名已经存在", vbOKOnly + vbExclamation, "注意")
    End If
End If
End If

End If
End Sub

Private Sub Command2_Click()
Unload Me
End Sub

⌨️ 快捷键说明

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