📄 frmeditstudent.frm
字号:
VERSION 5.00
Begin VB.Form FrmEditStudent
Caption = "修改考生信息"
ClientHeight = 5115
ClientLeft = 60
ClientTop = 345
ClientWidth = 8445
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 5115
ScaleWidth = 8445
StartUpPosition = 1 '所有者中心
Begin VB.OptionButton Option1
Caption = "不可考"
Height = 240
Index = 1
Left = 3420
TabIndex = 25
Top = 3915
Width = 1185
End
Begin VB.OptionButton Option1
Caption = "可考"
Height = 240
Index = 0
Left = 2475
TabIndex = 24
Top = 3915
Width = 1185
End
Begin VB.TextBox Text1
Appearance = 0 'Flat
Height = 330
Index = 4
Left = 2385
TabIndex = 21
Top = 3375
Width = 2085
End
Begin VB.CommandButton Command2
Caption = "浏览"
Enabled = 0 'False
Height = 330
Left = 6660
TabIndex = 20
Top = 2835
Width = 645
End
Begin VB.CommandButton Command1
Caption = "<<"
Height = 375
Index = 0
Left = 1800
TabIndex = 18
Top = 4365
Width = 420
End
Begin VB.CommandButton Command1
Caption = "<"
Height = 375
Index = 1
Left = 2250
TabIndex = 17
Top = 4365
Width = 420
End
Begin VB.CommandButton Command1
Caption = ">"
Height = 375
Index = 2
Left = 2700
TabIndex = 16
Top = 4365
Width = 420
End
Begin VB.CommandButton Command1
Caption = ">>"
Height = 375
Index = 3
Left = 3150
TabIndex = 15
Top = 4365
Width = 420
End
Begin VB.CommandButton Command1
Caption = "编辑"
Height = 375
Index = 4
Left = 3600
TabIndex = 14
Top = 4365
Width = 510
End
Begin VB.CommandButton Command1
Caption = "删除"
Height = 375
Index = 5
Left = 4140
TabIndex = 13
Top = 4365
Width = 510
End
Begin VB.CommandButton Command1
Caption = "更新"
Enabled = 0 'False
Height = 375
Index = 6
Left = 4680
TabIndex = 12
Top = 4365
Width = 510
End
Begin VB.CommandButton Command1
Caption = "返回"
Height = 375
Index = 7
Left = 5265
TabIndex = 11
Top = 4365
Width = 1185
End
Begin VB.TextBox Text1
Appearance = 0 'Flat
Height = 330
Index = 0
Left = 2385
TabIndex = 5
Top = 1260
Width = 2085
End
Begin VB.TextBox Text1
Appearance = 0 'Flat
Height = 330
Index = 1
Left = 2385
TabIndex = 4
Top = 1800
Width = 2085
End
Begin VB.TextBox Text1
Appearance = 0 'Flat
Height = 330
Index = 2
Left = 2385
TabIndex = 3
Top = 2340
Width = 2085
End
Begin VB.TextBox Text1
Appearance = 0 'Flat
Height = 330
Index = 3
Left = 2385
TabIndex = 2
Top = 2880
Width = 2085
End
Begin VB.Frame Frame1
Height = 60
Left = 495
TabIndex = 1
Top = 855
Width = 7485
End
Begin VB.Data Data1
Caption = "Data1"
Connect = "Access"
DatabaseName = "F:\My Documents\VB\考试管理系统\服务器\exmext.dll"
DefaultCursorType= 0 '缺省游标
DefaultType = 2 '使用 ODBC
Exclusive = 0 'False
Height = 375
Left = 3105
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = "Student"
Top = 5220
Visible = 0 'False
Width = 2220
End
Begin VB.PictureBox Picture1
DataField = "photo"
DataSource = "Data1"
Height = 1725
Left = 2025
ScaleHeight = 1665
ScaleWidth = 1305
TabIndex = 0
Top = 5265
Visible = 0 'False
Width = 1365
End
Begin VB.PictureBox CDlg
Height = 480
Left = 6885
ScaleHeight = 420
ScaleWidth = 1140
TabIndex = 26
Top = 1665
Width = 1200
End
Begin VB.Label Label1
Caption = "考试状态:"
Height = 330
Index = 5
Left = 1440
TabIndex = 23
Top = 3915
Width = 1320
End
Begin VB.Label Label1
Caption = "考试成绩:"
Height = 330
Index = 4
Left = 1440
TabIndex = 22
Top = 3420
Width = 1320
End
Begin VB.Label Label3
Caption = "照片"
Height = 285
Left = 4545
TabIndex = 19
Top = 1305
Width = 465
End
Begin VB.Label Label1
Caption = "准考证号:"
Height = 330
Index = 0
Left = 1440
TabIndex = 10
Top = 1305
Width = 1320
End
Begin VB.Label Label1
Caption = "班级:"
Height = 330
Index = 1
Left = 1440
TabIndex = 9
Top = 1800
Width = 1320
End
Begin VB.Label Label1
Caption = "姓名:"
Height = 330
Index = 2
Left = 1440
TabIndex = 8
Top = 2340
Width = 1320
End
Begin VB.Label Label1
Caption = "考生性别:"
Height = 330
Index = 3
Left = 1440
TabIndex = 7
Top = 2925
Width = 1320
End
Begin VB.Label Label2
AutoSize = -1 'True
Height = 180
Left = 1620
TabIndex = 6
Top = 630
Width = 90
End
Begin VB.Image Image2
Height = 660
Left = 630
Picture = "FrmEditStudent.frx":0000
Stretch = -1 'True
Top = 45
Width = 615
End
Begin VB.Image Image1
BorderStyle = 1 'Fixed Single
Height = 1860
Left = 5040
Picture = "FrmEditStudent.frx":0442
Stretch = -1 'True
Top = 1305
Width = 1500
End
End
Attribute VB_Name = "FrmEditStudent"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim FR As Boolean
Private Sub Command1_Click(Index As Integer)
'On Error Resume Next
Dim n As Integer
Select Case Index
Case 0
Data1.Recordset.MoveFirst
Case 1
If Data1.Recordset.AbsolutePosition <= 0 Then
MsgBox "已经是第一条记录!", vbInformation, "提示"
Data1.Recordset.MoveFirst
Exit Sub
End If
Data1.Recordset.MovePrevious
Case 2
If Data1.Recordset.AbsolutePosition >= Data1.Recordset.RecordCount - 1 Then
MsgBox "已经是最后一条记录!", vbInformation, "提示"
Data1.Recordset.MoveLast
Exit Sub
End If
Data1.Recordset.MoveNext
Case 3
Data1.Recordset.MoveLast
Case 4
Command1(4).Enabled = False
Command1(6).Enabled = True
Command2.Enabled = True
Case 5
If MsgBox("确认删除此题目吗?", vbInformation + vbYesNo, "提示") = vbYes Then
Data1.Recordset.Delete
Data1.Recordset.MoveFirst
Else
Exit Sub
End If
Case 6
Data1.Recordset.Edit
Picture1.Picture = Image1.Picture
Data1.Recordset.Fields(0) = Text1(0)
Data1.Recordset.Fields(1) = Text1(1)
Data1.Recordset.Fields(2) = Text1(2)
Data1.Recordset.Fields(3) = Text1(3)
Data1.Recordset.Fields(4) = Text1(4)
If Option1(0).Value = True Then
Data1.Recordset.Fields(6) = "0"
Else
Data1.Recordset.Fields(6) = "1"
End If
Data1.Recordset.Update
Command1(6).Enabled = False
Command1(4).Enabled = True
Command2.Enabled = False
Case 7
If Command1(6).Enabled = True Then
If MsgBox("确认放弃修改?", vbInformation + vbYesNo, "提示") = vbYes Then
Data1.Recordset.Close
Unload Me
Exit Sub
End If
Else
Data1.Recordset.Close
Unload Me
Exit Sub
End If
Exit Sub
End Select
Call ViewRS
End Sub
Sub ViewRS()
On Error Resume Next
Text1(0).Text = Data1.Recordset.Fields(0)
Text1(1).Text = Data1.Recordset.Fields(1)
Text1(2).Text = Data1.Recordset.Fields(2)
Text1(3).Text = Data1.Recordset.Fields(3)
Text1(4).Text = Data1.Recordset.Fields(4)
Option1(Val(Data1.Recordset.Fields(6))).Value = True
Image1.Picture = Picture1.Picture
Label2.Caption = "第 " & Data1.Recordset.AbsolutePosition + 1 & " 考生/共 " & Data1.Recordset.RecordCount & " 考生"
End Sub
Private Sub Command2_Click()
CDlg.FileName = ""
CDlg.ShowOpen
If CDlg.FileName <> "" Then
Image1.Picture = LoadPicture(CDlg.FileName)
End If
End Sub
Private Sub Form_Activate()
If FR = True Then
Data1.Recordset.MoveLast
Data1.Recordset.MoveFirst
Call ViewRS
FR = False
End If
End Sub
Private Sub Form_Load()
FR = True
Data1.DatabaseName = App.Path & "\" & StudentDB
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -