📄 form5.frm
字号:
VERSION 5.00
Begin VB.Form 成绩录入
Caption = "成绩录入"
ClientHeight = 8715
ClientLeft = 60
ClientTop = 390
ClientWidth = 9615
LinkTopic = "Form5"
Picture = "Form5.frx":0000
ScaleHeight = 8715
ScaleWidth = 9615
StartUpPosition = 3 '窗口缺省
Begin VB.TextBox Text4
BeginProperty Font
Name = "宋体"
Size = 15
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 3240
TabIndex = 11
Top = 3000
Width = 1815
End
Begin VB.CommandButton Command3
Caption = "ok"
BeginProperty Font
Name = "宋体"
Size = 26.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = -1 'True
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 6000
TabIndex = 10
Top = 1800
Width = 1095
End
Begin VB.TextBox Text3
BeginProperty Font
Name = "宋体"
Size = 15
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 3240
TabIndex = 9
Top = 4320
Width = 1815
End
Begin VB.ComboBox Combo2
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 360
ItemData = "Form5.frx":3BB4F
Left = 5760
List = "Form5.frx":3BB59
TabIndex = 8
Top = 5880
Width = 735
End
Begin VB.CommandButton Command2
Caption = "确认"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Left = 7800
TabIndex = 7
Top = 6480
Width = 1335
End
Begin VB.CommandButton Command1
Caption = "返回"
BeginProperty Font
Name = "宋体"
Size = 15.75
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Left = 7800
TabIndex = 6
Top = 7440
Width = 1335
End
Begin VB.TextBox Text2
BeginProperty Font
Name = "宋体"
Size = 15
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 3240
TabIndex = 5
Top = 5760
Width = 1815
End
Begin VB.TextBox Text1
BeginProperty Font
Name = "宋体"
Size = 15
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 3240
TabIndex = 4
Top = 1800
Width = 1815
End
Begin VB.Label Label5
BackStyle = 0 'Transparent
Caption = "运动员姓名"
BeginProperty Font
Name = "宋体"
Size = 15
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF00FF&
Height = 615
Left = 840
TabIndex = 12
Top = 3000
Width = 1695
End
Begin VB.Label Label4
BackStyle = 0 'Transparent
Caption = "请输入成绩"
BeginProperty Font
Name = "宋体"
Size = 15.75
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF00FF&
Height = 495
Left = 720
TabIndex = 3
Top = 5760
Width = 1815
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "运动项目"
BeginProperty Font
Name = "宋体"
Size = 15
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF00FF&
Height = 615
Left = 840
TabIndex = 2
Top = 4320
Width = 1695
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "请输入运动员编号"
BeginProperty Font
Name = "宋体"
Size = 15
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF00FF&
Height = 615
Left = 840
TabIndex = 1
Top = 1800
Width = 1695
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "成绩录入及编排"
BeginProperty Font
Name = "宋体"
Size = 26.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFC0FF&
Height = 615
Left = 2520
TabIndex = 0
Top = 360
Width = 3975
End
End
Attribute VB_Name = "成绩录入"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
登入界面.Show
Unload Me
End Sub
Private Sub Command2_Click()
Dim rs As ADODB.Command
Dim str As String
If Text1 = "" Then
MsgBox "输入的编号不能为空!"
Exit Sub
End If
If Text2 = "" Then
MsgBox "输入的成绩不能为空!"
Exit Sub
End If
Call OpenDB
Set rs = New ADODB.Command
str = "insert into 成绩表(编号,成绩,项目) "
str = str & "Values('" & Text1 & "','" & Text2 & "','" & Text3 & "')"
MsgBox "录入成功^_^"
Set rs.ActiveConnection = Conn
rs.CommandText = str
rs.Execute
Set rs = Nothing
Conn.Close
Set Conn = Nothing
End Sub
Private Sub Label6_Click()
End Sub
Private Sub Command3_Click()
Dim rs As ADODB.Recordset
Dim StrSQL As String
Set rs = New ADODB.Recordset
Call OpenDB
StrSQL = "SELECT* FROM 运动员信息表 WHERE 编号='" & Text1.Text & "'"
rs.Open StrSQL, Conn, adLockPessimistic
If Not rs.EOF Then
Text3.Text = rs("项目").Value
Text4.Text = rs("姓名").Value
Else
MsgBox "sorry,不存在此运动员!!!!"
End If
rs.Close
Conn.Close
Set Conn = Nothing
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -