frmModifyresult.frm
上传用户:rocksue
上传日期:2013-06-17
资源大小:41926k
文件大小:20k
- VERSION 5.00
- Begin VB.Form frmModifyresult
- Caption = "修改成绩信息"
- ClientHeight = 5280
- ClientLeft = 48
- ClientTop = 348
- ClientWidth = 7632
- LinkTopic = "Form1"
- MDIChild = -1 'True
- ScaleHeight = 5280
- ScaleWidth = 7632
- Begin VB.Frame Frame2
- Caption = "查看成绩信息"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 12
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 1092
- Left = 360
- TabIndex = 17
- Top = 2640
- Width = 6972
- Begin VB.CommandButton lastCommand
- Caption = "最后一条记录"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 12
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 492
- Left = 4920
- TabIndex = 21
- Top = 360
- Width = 1692
- End
- Begin VB.CommandButton nextCommand
- Caption = "下一条记录"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 12
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 492
- Left = 3360
- TabIndex = 20
- Top = 360
- Width = 1452
- End
- Begin VB.CommandButton previousCommand
- Caption = "上一条记录"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 12
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 492
- Left = 1800
- TabIndex = 19
- Top = 360
- Width = 1452
- End
- Begin VB.CommandButton firstCommand
- Caption = "第一条记录"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 12
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 492
- Left = 240
- TabIndex = 18
- Top = 360
- Width = 1452
- End
- End
- Begin VB.Frame Frame3
- Caption = "修改成绩信息"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 12
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 1092
- Left = 360
- TabIndex = 12
- Top = 3840
- Width = 6972
- Begin VB.CommandButton deleteCommand
- Caption = "删除记录"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 12
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 492
- Left = 5160
- TabIndex = 16
- Top = 360
- Width = 1452
- End
- Begin VB.CommandButton cancelCommand
- Caption = "取消修改记录"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 12
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 492
- Left = 3360
- TabIndex = 15
- Top = 360
- Width = 1692
- End
- Begin VB.CommandButton updateCommand
- Caption = "更新数据"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 12
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 492
- Left = 1800
- TabIndex = 14
- Top = 360
- Width = 1452
- End
- Begin VB.CommandButton editCommand
- Caption = "修改记录"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 12
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 492
- Left = 240
- TabIndex = 13
- Top = 360
- Width = 1452
- End
- End
- Begin VB.ComboBox comboClassno
- BeginProperty Font
- Name = "宋体"
- Size = 10.8
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 312
- ItemData = "frmModifyresult.frx":0000
- Left = 4800
- List = "frmModifyresult.frx":0002
- TabIndex = 5
- Top = 480
- Width = 1332
- End
- Begin VB.ComboBox comboSID
- BeginProperty Font
- Name = "宋体"
- Size = 10.8
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 312
- ItemData = "frmModifyresult.frx":0004
- Left = 1800
- List = "frmModifyresult.frx":0006
- TabIndex = 4
- Top = 960
- Width = 1332
- End
- Begin VB.TextBox txtName
- BeginProperty Font
- Name = "宋体"
- Size = 10.8
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 372
- Left = 4800
- TabIndex = 3
- Top = 960
- Width = 1332
- End
- Begin VB.TextBox txtResult
- BeginProperty Font
- Name = "宋体"
- Size = 10.8
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 372
- Left = 4800
- TabIndex = 2
- Top = 1440
- Width = 1332
- End
- Begin VB.ComboBox comboCourse
- BeginProperty Font
- Name = "宋体"
- Size = 10.8
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 312
- ItemData = "frmModifyresult.frx":0008
- Left = 1800
- List = "frmModifyresult.frx":000A
- TabIndex = 1
- Top = 1560
- Width = 1332
- End
- Begin VB.ComboBox comboExamtype
- BeginProperty Font
- Name = "宋体"
- Size = 10.8
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 312
- ItemData = "frmModifyresult.frx":000C
- Left = 1800
- List = "frmModifyresult.frx":000E
- TabIndex = 0
- Top = 480
- Width = 1332
- End
- Begin VB.Label Label1
- Caption = "选择班号:"
- BeginProperty Font
- Name = "宋体"
- Size = 10.8
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 252
- Left = 3360
- TabIndex = 11
- Top = 480
- Width = 1332
- End
- Begin VB.Label Label2
- Caption = "选择学号:"
- BeginProperty Font
- Name = "宋体"
- Size = 10.8
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 252
- Left = 480
- TabIndex = 10
- Top = 960
- Width = 1212
- End
- Begin VB.Label Label3
- Caption = "姓名:"
- BeginProperty Font
- Name = "宋体"
- Size = 10.8
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 252
- Left = 3600
- TabIndex = 9
- Top = 1080
- Width = 732
- End
- Begin VB.Label Label4
- Caption = "输入分数:"
- BeginProperty Font
- Name = "宋体"
- Size = 10.8
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 252
- Left = 3600
- TabIndex = 8
- Top = 1560
- Width = 1332
- End
- Begin VB.Label Label5
- Caption = "选择课程:"
- BeginProperty Font
- Name = "宋体"
- Size = 10.8
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 252
- Left = 480
- TabIndex = 7
- Top = 1560
- Width = 1212
- End
- Begin VB.Label Label6
- Caption = "考试编号:"
- BeginProperty Font
- Name = "宋体"
- Size = 10.8
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 252
- Left = 480
- TabIndex = 6
- Top = 480
- Width = 1212
- End
- End
- Attribute VB_Name = "frmModifyresult"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Dim mrc As ADODB.Recordset
- Dim myBookmark As Variant
- Private Sub cancelCommand_Click()
- mrc.Bookmark = myBookmark
- Call viewData
-
- firstCommand.Enabled = True
- lastCommand.Enabled = True
- previousCommand.Enabled = True
- nextCommand.Enabled = True
-
- updateCommand.Enabled = False
- cancelCommand.Enabled = False
-
- comboExamtype.Enabled = False
- comboClassno.Enabled = False
- comboSID.Enabled = False
- comboCourse.Enabled = False
- txtName.Enabled = False
- txtResult.Enabled = False
-
- End Sub
- Private Sub comboSID_Click()
- Dim mrcc As ADODB.Recordset
- Dim txtSQL As String
- Dim MsgText As String
-
- txtSQL = "select * from student_Info where student_ID = '" & comboSID.Text & "'"
- Set mrcc = ExecuteSQL(txtSQL, MsgText)
- txtName.Text = mrcc!student_Name
- mrcc.Close
-
- End Sub
- Private Sub deleteCommand_Click()
- Dim MsgText As String
-
- myBookmark = mrc.Bookmark
- str2$ = MsgBox("是否删除当前记录?", vbOKCancel, "删除当前记录")
- If str2$ = vbOK Then
- mrc.MoveNext
- If mrc.EOF Then
- mrc.MoveFirst
- myBookmark = mrc.Bookmark
- mrc.MoveLast
- mrc.Delete
- mrc.Close
-
- txtSQL = "select * from result_Info"
- Set mrc = ExecuteSQL(txtSQL, MsgText)
- mrc.MoveLast
- Call viewData
- Else
- myBookmark = mrc.Bookmark
- mrc.MovePrevious
- mrc.Delete
- mrc.Close
-
- txtSQL = "select * from result_Info"
- Set mrc = ExecuteSQL(txtSQL, MsgText)
- mrc.MoveLast
- Call viewData
- End If
- Else
- mrc.Bookmark = myBookmark
- Call viewData
- End If
- End Sub
- Private Sub editCommand_Click()
- Dim mrcc As ADODB.Recordset
- Dim txtSQL As String
- Dim MsgText As String
-
-
-
- firstCommand.Enabled = False
- lastCommand.Enabled = False
- previousCommand.Enabled = False
- nextCommand.Enabled = False
-
- updateCommand.Enabled = True
- cancelCommand.Enabled = True
-
- comboExamtype.Enabled = True
- comboClassno.Enabled = True
- comboSID.Enabled = True
- comboCourse.Enabled = True
- txtName.Enabled = True
- txtResult.Enabled = True
-
- comboExamtype.AddItem "2000期中"
- comboExamtype.AddItem "2000期末"
- comboExamtype.AddItem "2001期中"
- comboExamtype.AddItem "2001期末"
-
- txtSQL = "select * from class_Info "
- Set mrcc = ExecuteSQL(txtSQL, MsgText)
- While (mrcc.EOF = False)
- comboClassno.AddItem mrcc!class_No
- mrcc.MoveNext
- Wend
- mrcc.Close
- myBookmark = mrc.Bookmark
-
- End Sub
- Private Sub firstCommand_Click()
- mrc.MoveFirst
- Call viewData
- End Sub
- Private Sub Form_Load()
- Dim txtSQL As String
- Dim MsgText As String
-
- comboExamtype.Enabled = False
- comboClassno.Enabled = False
- comboSID.Enabled = False
- comboCourse.Enabled = False
- txtName.Enabled = False
- txtResult.Enabled = False
- updateCommand.Enabled = False
- cancelCommand.Enabled = False
-
-
- txtSQL = "select * from result_Info "
- Set mrc = ExecuteSQL(txtSQL, MsgText)
-
- If mrc.EOF = False Then
- mrc.MoveFirst
- Call viewData
- myBookmark = mrc.Bookmark
- Else
- MsgBox "没有纪录!", vbOKOnly + vbExclamation, "警告"
- Exit Sub
- End If
-
-
- End Sub
- Public Sub viewData()
- comboExamtype.Text = mrc!exam_No
- comboClassno.Text = mrc!class_No
- comboSID.Text = mrc!student_ID
- comboCourse.Text = mrc!course_Name
- txtName.Text = mrc!student_Name
- txtResult.Text = mrc!result
- End Sub
-
- Private Sub lastCommand_Click()
- mrc.MoveLast
- Call viewData
- End Sub
- Private Sub nextCommand_Click()
- mrc.MoveNext
- If mrc.EOF Then
- mrc.MoveFirst
- End If
- Call viewData
- End Sub
- Private Sub previousCommand_Click()
- mrc.MovePrevious
- If mrc.BOF Then
- mrc.MoveLast
- End If
- Call viewData
- End Sub
- Private Sub updateCommand_Click()
- Dim MsgText As String
-
-
-
-
- If Not Testtxt(comboExamtype.Text) Then
- MsgBox "请输入考试编号!", vbOKOnly + vbExclamation, "警告"
- Exit Sub
- End If
-
- If Not Testtxt(comboClassno.Text) Then
- MsgBox "请选择班号!", vbOKOnly + vbExclamation, "警告"
- Exit Sub
- End If
-
- If Not Testtxt(comboSID.Text) Then
- MsgBox "请选择学号!", vbOKOnly + vbExclamation, "警告"
- Exit Sub
- End If
-
- If Not Testtxt(comboCourse.Text) Then
- MsgBox "请选择课程!", vbOKOnly + vbExclamation, "警告"
- Exit Sub
- End If
-
- If Not Testtxt(txtResult.Text) Then
- MsgBox "请输入分数!", vbOKOnly + vbExclamation, "警告"
- Exit Sub
- End If
-
- If Not IsNumeric(txtResult.Text) Then
- MsgBox "分数请输入数字!", vbOKOnly + vbExclamation, "警告"
- Exit Sub
- End If
-
-
- mrc.Fields(0) = comboExamtype.Text
- mrc.Fields(1) = comboSID.Text
- mrc.Fields(2) = txtName.Text
- mrc.Fields(3) = comboClassno.Text
- mrc.Fields(4) = comboCourse.Text
- mrc.Fields(5) = txtResult.Text
- mrc.Update
- mrc.Close
-
- MsgBox "修改成绩成功!", vbOKOnly + vbExclamation, "警告"
- comboExamtype.Clear
- comboClassno.Clear
- comboSID.Clear
- comboCourse.Clear
-
- txtSQL = "select * from result_Info"
- Set mrc = ExecuteSQL(txtSQL, MsgText)
-
- mrc.MoveLast
- Call viewData
-
- firstCommand.Enabled = True
- lastCommand.Enabled = True
- previousCommand.Enabled = True
- nextCommand.Enabled = True
-
- updateCommand.Enabled = False
- cancelCommand.Enabled = False
-
- comboExamtype.Enabled = False
- comboClassno.Enabled = False
- comboSID.Enabled = False
- comboCourse.Enabled = False
- txtName.Enabled = False
- txtResult.Enabled = False
-
-
-
-
-
-
- End Sub
- Private Sub comboClassno_Click()
- Dim mrcc As ADODB.Recordset
- Dim txtSQL As String
- Dim MsgText As String
-
-
-
-
- txtSQL = "select * from student_Info where class_NO = '" & comboClassno.Text & "'"
- Set mrcc = ExecuteSQL(txtSQL, MsgText)
- While (mrcc.EOF = False)
- comboSID.AddItem mrcc!student_ID
- mrcc.MoveNext
- Wend
- mrcc.Close
-
- txtSQL = "select * from class_Info where class_No = '" & comboClassno.Text & "'"
- Set mrcc = ExecuteSQL(txtSQL, MsgText)
- Grade = mrcc!Grade
- mrcc.Close
-
- txtSQL = "select * from gradecourse_Info where grade = '" & Grade & "'"
- Set mrcc = ExecuteSQL(txtSQL, MsgText)
- While (mrcc.EOF = False)
- comboCourse.AddItem mrcc!course_Name
- mrcc.MoveNext
- Wend
- mrcc.Close
-
-
-
- End Sub