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

📄 frdelid.frm

📁 图书管理系统
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frdelID 
   Caption         =   "Form1"
   ClientHeight    =   1950
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   3750
   LinkTopic       =   "Form1"
   ScaleHeight     =   1950
   ScaleWidth      =   3750
   StartUpPosition =   2  '屏幕中心
   Begin VB.CommandButton Command2 
      Caption         =   "取消"
      Height          =   375
      Left            =   2160
      TabIndex        =   3
      Top             =   1320
      Width           =   1095
   End
   Begin VB.CommandButton Command1 
      Caption         =   "删除"
      Height          =   375
      Left            =   480
      TabIndex        =   2
      Top             =   1320
      Width           =   1095
   End
   Begin VB.TextBox Text1 
      Height          =   375
      Left            =   1200
      TabIndex        =   0
      Top             =   360
      Width           =   2055
   End
   Begin VB.Label Label1 
      Caption         =   "用户名:"
      Height          =   375
      Left            =   480
      TabIndex        =   1
      Top             =   480
      Width           =   735
   End
End
Attribute VB_Name = "frdelID"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim sql As String
Dim rs_delID As New ADODB.Recordset
Dim conn As New ADODB.Connection
conn.Open "provider=Microsoft.jet.oledb.4.0;data source=" & App.Path & "\database.mdb"
If Trim(Text1.Text) = "" Then
   MsgBox "用户名不能为空,请重新输入!"
   Text1.SetFocus
Else
  sql = "select * from 用户表 where user_ID='" & Trim(Text1.Text) & "'"
  rs_delID.Open sql, conn, adOpenKeyset, adLockPessimistic
  If rs_delID.EOF = True Then
  MsgBox "没有这个用户,请输入正确的用户名!", vbOKOnly + vbExclamation, ""
  Text1.Text = ""
  Text1.SetFocus
  Else
   MsgBox "确定删除吗?", vbYesNo, ""
   sql = "detele from 用户表 where user_ID='" & Trim(Text1.Text) & "'"
    rs_delID.CursorLocation = adUseClient
   rs_delID.Open sql, conn, adOpenKeyset, adLockPessimistic
   End If
 End If


End Sub

Private Sub Command2_Click()
Unload Me
End Sub

⌨️ 快捷键说明

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