📄 form2.frm
字号:
VERSION 5.00
Begin VB.Form Add
Caption = "添加记录"
ClientHeight = 3105
ClientLeft = 60
ClientTop = 450
ClientWidth = 4440
LinkTopic = "Form2"
ScaleHeight = 3105
ScaleWidth = 4440
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command2
Caption = "取消"
Height = 495
Left = 2520
TabIndex = 12
Top = 2400
Width = 1095
End
Begin VB.CommandButton Command1
Caption = "确定"
Height = 495
Left = 480
TabIndex = 11
Top = 2400
Width = 1095
End
Begin VB.ComboBox Combo1
Height = 300
ItemData = "Form2.frx":0000
Left = 960
List = "Form2.frx":0002
TabIndex = 10
Text = "1"
Top = 750
Width = 855
End
Begin VB.Frame Frame1
Caption = "成绩"
Height = 855
Left = 240
TabIndex = 5
Top = 1320
Width = 3975
Begin VB.TextBox Text7
Height = 270
Left = 3120
TabIndex = 9
Text = "77"
Top = 360
Width = 615
End
Begin VB.TextBox Text6
Height = 270
Left = 2160
TabIndex = 8
Text = "66"
Top = 360
Width = 615
End
Begin VB.TextBox Text5
Height = 270
Left = 1200
TabIndex = 7
Text = "55"
Top = 360
Width = 615
End
Begin VB.TextBox Text4
Height = 270
Left = 240
TabIndex = 6
Text = "44"
Top = 360
Width = 615
End
End
Begin VB.TextBox Text2
Height = 270
Left = 3000
TabIndex = 1
Text = "09432065"
Top = 185
Width = 855
End
Begin VB.TextBox Text1
Height = 270
Left = 960
TabIndex = 0
Text = "小红"
Top = 185
Width = 855
End
Begin VB.Label Label3
Caption = "性别"
Height = 255
Left = 360
TabIndex = 4
Top = 840
Width = 375
End
Begin VB.Label Label2
Caption = "学号"
Height = 255
Left = 2400
TabIndex = 3
Top = 240
Width = 375
End
Begin VB.Label Label1
Caption = "姓名"
Height = 255
Left = 360
TabIndex = 2
Top = 240
Width = 375
End
End
Attribute VB_Name = "Add"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'添加
Private Sub Command1_Click()
If Text1.Text = "" Or Text2.Text = "" Or Text4.Text = "" Or Text5.Text = "" Or Text6.Text = "" Or Text7.Text = "" Then
MsgBox "信息填写不完整"
Else
msql = "insert into 1 (姓名,学号,性别,成绩1,成绩2,成绩3,成绩4) values('" + Add.Text1.Text + "','" + Add.Text2.Text + "','" + Add.Combo1.Text + "','" + Add.Text4.Text + "','" + Add.Text5.Text + "','" + Add.Text6.Text + "','" + Add.Text7.Text + "')"
rs.Open msql, db, adOpenStatic, adLockOptimistic
End If
show_all
Unload Me
End Sub
'退出
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
Combo1.AddItem "1"
Combo1.AddItem "2"
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -