📄 frmedit.frm
字号:
VERSION 5.00
Begin VB.Form frmEdit
BorderStyle = 4 'Fixed ToolWindow
Caption = "更改**的成绩"
ClientHeight = 1575
ClientLeft = 45
ClientTop = 285
ClientWidth = 3645
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 1575
ScaleWidth = 3645
ShowInTaskbar = 0 'False
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command3
Caption = "还原"
Height = 315
Left = 2355
TabIndex = 10
Top = 1140
Width = 1185
End
Begin VB.CommandButton Command2
Caption = "取消"
Height = 315
Left = 2355
TabIndex = 9
Top = 675
Width = 1185
End
Begin VB.CommandButton Command1
Caption = "确定"
Height = 315
Left = 2355
TabIndex = 8
Top = 150
Width = 1185
End
Begin VB.TextBox Text4
Height = 270
Left = 720
TabIndex = 7
Top = 1155
Width = 1350
End
Begin VB.TextBox Text3
Height = 270
Left = 720
TabIndex = 6
Top = 800
Width = 1350
End
Begin VB.TextBox Text2
Height = 270
Left = 720
TabIndex = 5
Top = 445
Width = 1350
End
Begin VB.TextBox Text1
Height = 270
Left = 720
TabIndex = 4
Top = 90
Width = 1350
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "计算机:"
Height = 180
Left = 30
TabIndex = 3
Top = 1185
Width = 720
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "英语:"
Height = 180
Left = 210
TabIndex = 2
Top = 795
Width = 540
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "语文:"
Height = 180
Left = 210
TabIndex = 1
Top = 450
Width = 540
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "数学:"
Height = 180
Left = 210
TabIndex = 0
Top = 90
Width = 540
End
End
Attribute VB_Name = "frmEdit"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Declare Function GetTickCount Lib "kernel32" () As Long
Dim cID As Integer
Sub LoadEdit(ByVal ID As Integer)
cID = ID
Dim rec As New ADODB.Recordset
rec.Open "select A.Name,B.* from [tblInfos] as A,[tblMarks] as B where A.ID=B.ID and A.ID=" & ID, Con
Caption = "更改[" & rec("Name") & "]的成绩"
Text1 = rec("Math")
Text2 = rec("Chinese")
Text3 = rec("English")
Text4 = rec("IT")
rec.Close
Set rec = Nothing
End Sub
Private Sub Command1_Click()
Dim rec As New ADODB.Recordset, i As Long
rec.Open "select * from [tblMarks] where ID=" & cID, Con, 1, 3
rec("math") = Text1
rec("chinese") = Text2
rec("English") = Text3
rec("IT") = Text4
rec.Update
i = GetTickCount
Do While rec.State = adStateExecuting
DoEvents
If GetTickCount - i >= 1500 Then
MsgBox "更新超时,可能已经失败"
Exit Do
End If
Loop
rec.Close
Set rec = Nothing
Hide
End Sub
Private Sub Command2_Click()
Hide
End Sub
Private Sub Command3_Click()
LoadEdit cID
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -