📄 frmdelstudent.frm
字号:
VERSION 5.00
Begin VB.Form frmdelstudent
BackColor = &H00FFFFFF&
BorderStyle = 1 'Fixed Single
Caption = "删除学生资料"
ClientHeight = 1560
ClientLeft = 45
ClientTop = 435
ClientWidth = 3540
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 1560
ScaleWidth = 3540
Begin VB.CommandButton CmdQuit
Cancel = -1 'True
Caption = "返回"
Height = 420
Left = 2145
TabIndex = 2
Top = 945
Width = 1050
End
Begin VB.CommandButton CmdOK
Caption = "确认"
Default = -1 'True
Height = 420
Left = 480
TabIndex = 1
Top = 945
Width = 1050
End
Begin VB.TextBox txtID
Height = 330
Left = 1665
TabIndex = 0
Top = 360
Width = 1485
End
Begin VB.Label Label1
BackColor = &H00FFFFFF&
Caption = "请输入学号:"
Height = 240
Left = 480
TabIndex = 3
Top = 405
Width = 1185
End
End
Attribute VB_Name = "frmdelstudent"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim sID2 As String
Private Sub CmdOK_Click()
Dim sCon As String
If txtID.Text = "" Then
txtID.Text = "请输学号"
txtID.SelStart = 0
txtID.SelLength = Len(txtID.Text)
txtID.SetFocus
Exit Sub
End If
sCon = "select * from student where id='" & txtID.Text & "'"
Set adoRS = adoCon.Execute(sCon)
If adoRS.EOF Then
MsgBox "对不起,查无此人,请执行系统查询功能," _
& vbCrLf & vbCrLf & "确认要删除的学号后再进行删除。", _
vbInformation + vbOKOnly, "系统提示"
txtID.SetFocus
txtID.SelStart = 0
txtID.SelLength = Len(txtID.Text)
Exit Sub
Else
sCon = "select name from student where id='" & txtID.Text & "'"
Set adoRS = adoCon.Execute(sCon)
sID2 = Trim(adoRS("Name"))
If MsgBox("学号:" & txtID.Text & vbCrLf & "姓名:" & sID2 & vbCrLf & "确实要删除该学生的资料吗?", vbQuestion + vbYesNo, "系统提示") = vbYes Then
sCon = "delete from student where id='" & txtID.Text & "'"
Set adoRS = adoCon.Execute(sCon)
MsgBox "删除成功!", vbInformation + vbOKOnly, "系统提示"
txtID.Text = ""
End If
End If
End Sub
Private Sub cmdQuit_Click()
Unload Me
End Sub
Private Sub Form_Load()
Me.Move (Screen.Width - Me.Width) / 2, (Screen.Height - Me.Height) / 2 - 800
Me.Height = 2040
Me.Width = 3630
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -