frmdeluser.frm

来自「通讯录」· FRM 代码 · 共 79 行

FRM
79
字号
VERSION 5.00
Begin VB.Form frmDeluser 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "删除用户"
   ClientHeight    =   1620
   ClientLeft      =   45
   ClientTop       =   435
   ClientWidth     =   4680
   Icon            =   "frmDeluser.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MDIChild        =   -1  'True
   MinButton       =   0   'False
   ScaleHeight     =   1620
   ScaleWidth      =   4680
   ShowInTaskbar   =   0   'False
   Begin VB.TextBox txtUser 
      BackColor       =   &H8000000E&
      Height          =   405
      Left            =   2280
      MaxLength       =   30
      TabIndex        =   0
      Top             =   240
      Width           =   1695
   End
   Begin VB.CommandButton cmdDelete 
      Caption         =   "删除(&D)"
      Height          =   495
      Left            =   1080
      TabIndex        =   1
      Top             =   960
      Width           =   1335
   End
   Begin VB.CommandButton cmdBack 
      Caption         =   "返回(&B)"
      Height          =   495
      Left            =   2760
      TabIndex        =   2
      Top             =   960
      Width           =   1335
   End
   Begin VB.Label Label7 
      AutoSize        =   -1  'True
      Caption         =   "请输入用户名:"
      Height          =   180
      Left            =   600
      TabIndex        =   3
      Top             =   360
      Width           =   1260
   End
End
Attribute VB_Name = "frmDeluser"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdBack_Click()
Unload frmDeluser
End Sub

Private Sub cmdDelete_Click()
Dim strUser$
strUser = Trim(txtUser.Text)
If strUser = "" Then
    MsgBox "请输入用户名!", 48, "删除"
    Exit Sub
End If
strSQL = "select * from userinfo where uname='" + strUser + "'"
Set RS = conn.Execute(strSQL)
If RS.EOF Then
   MsgBox "无此人信息!", 48, "删除"
   RS.Close
   Exit Sub
End If
strSQL = "delete from userinfo where uname='" + strUser + "'"
conn.Execute strSQL
MsgBox "删除成功!", 64, "删除"
End Sub

⌨️ 快捷键说明

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