删除用户.frm

来自「功能齐全的图书管理系统。包含设计文档」· FRM 代码 · 共 92 行

FRM
92
字号
VERSION 5.00
Begin VB.Form 删除用户 
   Caption         =   "删除用户"
   ClientHeight    =   3495
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   5775
   LinkTopic       =   "Form1"
   ScaleHeight     =   3495
   ScaleWidth      =   5775
   StartUpPosition =   1  '所有者中心
   Begin VB.TextBox Text1 
      Height          =   270
      Left            =   2040
      TabIndex        =   2
      Top             =   1560
      Width           =   1455
   End
   Begin VB.CommandButton Command1 
      Caption         =   "确定"
      Height          =   375
      Left            =   1320
      TabIndex        =   1
      Top             =   2280
      Width           =   975
   End
   Begin VB.CommandButton Command2 
      Caption         =   "返回"
      Height          =   375
      Left            =   3240
      TabIndex        =   0
      Top             =   2280
      Width           =   855
   End
   Begin VB.Label Label1 
      Alignment       =   2  'Center
      Caption         =   "请输入需要删除的借书证号"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   15.75
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   735
      Left            =   1440
      TabIndex        =   3
      Top             =   600
      Width           =   2775
   End
End
Attribute VB_Name = "删除用户"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim Error_num As Integer
If Text1.Text = "" Then
    MsgBox "数据输入不完整,请重新输入!", vbOKOnly, "输入错误!"
    Exit Sub
End If
Mycom.ActiveConnection = Mycon
Mycom.CommandType = adCmdStoredProc
Mycom.CommandText = "删除用户"
Mycom.Parameters(1) = 0
Mycom.Parameters(2) = Text1.Text
Mycom.Execute
Error_num = Mycom.Parameters(1)
If Error_num = 2 Then
    MsgBox "该借书证号不存在!请重新输入!", vbOKOnly, "删除失败!"
    Text1.Text = ""
Else
    If Error_num = 3 Then
        MsgBox "该证件有借阅记录!不能删除该用户信息!", vbOKOnly, "删除失败!"
        Text1.Text = ""
    Else: MsgBox "该用户信息已成功从“用户信息”表中删除!", vbOKOnly, "删除成功!"
    End If
End If
Set Mycom = Nothing
End Sub

Private Sub Command2_Click()
Unload Me
End Sub

Private Sub Form_Load()
Me.Show
End Sub

⌨️ 快捷键说明

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