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

📄 frmdellive.frm

📁 用VB实现的一个学生管理系统
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmdellive 
   BackColor       =   &H00FFFFFF&
   BorderStyle     =   1  'Fixed Single
   Caption         =   "删除宿舍资料"
   ClientHeight    =   1335
   ClientLeft      =   45
   ClientTop       =   435
   ClientWidth     =   3180
   ControlBox      =   0   'False
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   1335
   ScaleWidth      =   3180
   Begin VB.ComboBox coblive 
      Height          =   300
      Left            =   1320
      TabIndex        =   2
      Text            =   "coblive"
      Top             =   240
      Width           =   1695
   End
   Begin VB.CommandButton CmdQuit 
      Cancel          =   -1  'True
      Caption         =   "返回"
      Height          =   420
      Left            =   1905
      TabIndex        =   1
      Top             =   720
      Width           =   1050
   End
   Begin VB.CommandButton CmdOK 
      Caption         =   "确认删除"
      Default         =   -1  'True
      Height          =   420
      Left            =   240
      TabIndex        =   0
      Top             =   720
      Width           =   1050
   End
   Begin VB.Label Label1 
      BackColor       =   &H00FFFFFF&
      Caption         =   "选择宿舍:"
      Height          =   360
      Left            =   240
      TabIndex        =   3
      Top             =   240
      Width           =   945
   End
End
Attribute VB_Name = "frmdellive"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub CmdOK_Click()
Dim sCon As String
sCon = "select * from Room where 宿舍='" & coblive.Text & "'"
Set adoRS = adoCon.Execute(sCon)
If adoRS.EOF Then
   MsgBox "对不起,查无此宿舍,请执行系统查询功能," _
          & vbCrLf & vbCrLf & "确认要删除的宿舍编号后再进行删除。", _
          vbInformation + vbOKOnly, "系统提示"
 coblive.SetFocus
    
   Exit Sub
Else
  Dim sql As String
On Error GoTo errMsg
sql = MsgBox("你真的要删除当前数据吗,请慎重处理!", vbInformation _
     + vbOKCancel + vbDefaultButton2, "系统提示")
If sql = vbCancel Then
  Exit Sub
End If

sql = ""
sql = "delete Room where 宿舍='" & coblive.Text & "'"
adoCon.Execute (sql)
sql = MsgBox("删除成功!", vbInformation _
     + vbOK, "系统提示")
errMsg:
  If Err.Number <> 0 Then
     MsgBox Err.Description, , "系统错误"
  End If

End If


End Sub

Private Sub cmdQuit_Click()
Unload Me
End Sub

Private Sub Form_Load()

Me.Width = 3270
Me.Height = 1815
Me.Move (Screen.Width - Me.Width) / 2, (Screen.Height - Me.Height) / 2 - 800

Me.Show
coblive.SetFocus
'宿舍
Set adoRS = adoCon.Execute("Select Name From Live Order By Name")
coblive.Clear
Do While Not adoRS.EOF
  coblive.AddItem Trim(adoRS("Name"))
  adoRS.MoveNext
Loop
coblive.ListIndex = 0


End Sub

⌨️ 快捷键说明

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