📄 form3.frm
字号:
VERSION 5.00
Begin VB.Form Form3
Caption = "Form3"
ClientHeight = 3090
ClientLeft = 60
ClientTop = 450
ClientWidth = 4680
LinkTopic = "Form3"
ScaleHeight = 3090
ScaleWidth = 4680
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command1
Caption = "确认"
Height = 495
Left = 1320
TabIndex = 2
Top = 1800
Width = 1695
End
Begin VB.TextBox Text1
Height = 615
Left = 2160
TabIndex = 0
Top = 480
Width = 2175
End
Begin VB.Label Label1
Caption = "请输入要删除记录的姓名"
Height = 375
Left = 240
TabIndex = 1
Top = 600
Width = 1575
End
End
Attribute VB_Name = "Form3"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim cnn As New ADODB.Connection
Dim rs As New ADODB.Recordset
cnn.Open "provider=sqloledb;server=(local);uid=sa;pwd=;database=student"
rs.Open "select * from 学生", cnn, adOpenKeyset, adLockOptimistic, adCmdText
rs.MoveFirst
Do Until rs.EOF
rs.Find "姓名='" & Text1 & "'"
Exit Do
rs.MoveNext
Loop
rs.Delete
rs.Close
cnn.Close
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -