📄 form6.frm
字号:
VERSION 5.00
Begin VB.Form Form6
Caption = "删除记录窗体"
ClientHeight = 2925
ClientLeft = 4065
ClientTop = 2640
ClientWidth = 4680
LinkTopic = "Form6"
ScaleHeight = 2925
ScaleWidth = 4680
Begin VB.Data Data1
Caption = "Data1"
Connect = "Access"
DatabaseName = ""
DefaultCursorType= 0 '缺省游标
DefaultType = 2 '使用 ODBC
Exclusive = 0 'False
Height = 375
Left = 960
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = ""
Top = 2400
Visible = 0 'False
Width = 2895
End
Begin VB.CommandButton Command2
Caption = "取消"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 2640
TabIndex = 3
Top = 1560
Width = 1335
End
Begin VB.CommandButton Command1
Caption = "删除"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 840
TabIndex = 2
Top = 1560
Width = 1335
End
Begin VB.TextBox Text1
Height = 495
Left = 2160
TabIndex = 1
Top = 480
Width = 2055
End
Begin VB.Label Label1
Caption = "请输入学号"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 480
TabIndex = 0
Top = 600
Width = 1335
End
End
Attribute VB_Name = "Form6"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
'删除指定的学生记录
Data1.DatabaseName = App.Path & "\db1.mdb"
Data1.RecordSource = "select * from 学生信息 where 学生信息.学号='" & Text1.Text & " '"
Data1.Refresh
If Data1.Recordset.EOF Then
MsgBox ("无此学生记录")
Else
Data1.Recordset.Delete
Data1.Refresh
MsgBox ("成功删除记录")
End If
Form6.Hide
End Sub
Private Sub Command2_Click()
Form4.Show
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -