📄 frm_tfdj.frm
字号:
VERSION 5.00
Begin VB.Form Frm_tfdj
Caption = "Form1"
ClientHeight = 2715
ClientLeft = 60
ClientTop = 405
ClientWidth = 5760
LinkTopic = "Form1"
ScaleHeight = 2715
ScaleWidth = 5760
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Cmd_tf
Caption = "退房"
Height = 495
Left = 3000
TabIndex = 2
Top = 1560
Width = 1455
End
Begin VB.TextBox txt_xh
Height = 495
Left = 2760
TabIndex = 0
Top = 600
Width = 1935
End
Begin VB.Label Label1
Alignment = 2 'Center
Caption = "请输入学号"
Height = 495
Left = 720
TabIndex = 1
Top = 720
Width = 1455
End
End
Attribute VB_Name = "Frm_tfdj"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim sql As String
Private Sub Command1_Click()
End Sub
Private Sub Cmd_tf_Click()
Err = 1
Dim cnn As New ADODB.Connection
Dim rst As New ADODB.Recordset
Dim i As Integer, j As Integer, k As Integer
sql = "select * from 宿舍 where 姓名='" + Trim(txt_xh.Text) + "'"
cnn.Open strcnn
rst.Open sql, cnn, adOpenStatic, adLockReadOnly
If rst.RecordCount > 0 Then
sql = "delete 宿舍 where 姓名='" + Trim(txt_xh.Text) + "'"
rst.Close
cnn.Close
cnn.Open strcnn
rst.Open sql, cnn, adOpenStatic, adLockReadOnly
If Err = 0 Then
MsgBox "退房成功"
Unload Me
End If
Else: MsgBox "没有此记录!"
Unload Me
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -