📄 form4.frm
字号:
VERSION 5.00
Begin VB.Form 修改运动员信息
Caption = "修改运动员信息"
ClientHeight = 7590
ClientLeft = 60
ClientTop = 390
ClientWidth = 9915
LinkTopic = "Form4"
Picture = "Form4.frx":0000
ScaleHeight = 7590
ScaleWidth = 9915
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 = 2400
TabIndex = 11
Top = 3720
Width = 2295
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 = 2400
TabIndex = 9
Top = 2880
Width = 2295
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 = 5160
TabIndex = 8
Top = 1440
Width = 2535
End
Begin VB.CommandButton Command3
Caption = "查询"
BeginProperty Font
Name = "宋体"
Size = 15
Charset = 134
Weight = 700
Underline = 0 'False
Italic = -1 'True
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 8040
TabIndex = 5
Top = 1440
Width = 1095
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 = 2400
TabIndex = 4
Top = 2160
Width = 2295
End
Begin VB.CommandButton Command2
Caption = "修改"
BeginProperty Font
Name = "宋体"
Size = 15
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Left = 8040
TabIndex = 3
Top = 5640
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 = 8040
TabIndex = 2
Top = 6600
Width = 1335
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 = &H000000FF&
Height = 495
Left = 960
TabIndex = 10
Top = 2160
Width = 975
End
Begin VB.Label Label6
BackStyle = 0 'Transparent
Caption = "性别:"
BeginProperty Font
Name = "宋体"
Size = 15
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 495
Left = 960
TabIndex = 7
Top = 3720
Width = 975
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 = &H000000FF&
Height = 495
Left = 960
TabIndex = 6
Top = 2880
Width = 975
End
Begin VB.Label Label3
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 = &H000000FF&
Height = 495
Left = 720
TabIndex = 1
Top = 1440
Width = 4215
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "修改运动员信息"
BeginProperty Font
Name = "宋体"
Size = 24
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C0C0C0&
Height = 615
Left = 2880
TabIndex = 0
Top = 360
Width = 3855
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
Set rs = New ADODB.Command
Call OpenDB
str = "update 运动员信息表 set 姓名= '" & Text2.Text & "', 学院= '" & Text3.Text & "',性别= '" & Text4.Text & "'"
Set rs.ActiveConnection = Conn
rs.CommandText = str
rs.Execute
Set rs = Nothing
Conn.Close
Set Conn = Nothing
MsgBox "修改成功"
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
Text2.Text = rs("姓名").Value
Text3.Text = rs("学院").Value
Text4.Text = rs("性别").Value
Else
MsgBox "运动员不存在哦!!!"
End If
rs.Close
Conn.Close
Set Conn = Nothing
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -