VB+SQL server学生信息管理系统毕业论文附源代码 第27页
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
.........................................................................................................
.......................... frmSetcourseinfo 设置年级课程窗口代码 .................................
Option Explicit
Dim flagSet As Boolean
Dim flagGrade As Boolean
Private Sub cmdAdd_Click()
If listAllcourse.ListIndex <> -1 Then
listSelectcourse.AddItem listAllcourse.List(listAllcourse.ListIndex)
End If
End Sub
Private Sub cmdDelete_Click()
If listSelectcourse.ListIndex <> -1 Then
listSelectcourse.RemoveItem listSelectcourse.ListIndex
End If
End Sub
Private Sub cmdExit_Click()
Unload Me
End Sub
Private Sub cmdModify_Click()
Dim i As Integer
Dim mrc As ADODB.Recordset
Dim mrcc As ADODB.Recordset
Dim txtSQL As String
Dim MsgText As String
Dim myBookmark As Variant
If Not Testtxt(comboGrade.Text) Then
MsgBox "请先选择年级!", vbOKOnly + vbExclamation, "警告"
Exit Sub
End If
If Not Testtxt(listSelectcourse.List(0)) Then
MsgBox "请选择课程!", vbOKOnly + vbExclamation, "警告"
Exit Sub
End If
txtSQL = "select * from gradecourse_Info where grade = '" & Trim(comboGrade.Text) & "'"
Set mrc = ExecuteSQL(txtSQL, MsgText)
If mrc.EOF Then
For i = 1 To listSelectcourse.ListCount
mrc.AddNew
mrc.Fields(0) = comboGrade.Text
mrc.Fields(1) = listSelectcourse.List(i - 1)
mrc.Update
Next i
mrc.Close
MsgBox "课程设置成功!", vbOKOnly + vbExclamation, "警告"
Else
mrc.Close
txtSQL = "delete from gradecourse_Info where grade = '" & Trim(comboGrade.Text) & "'"
Set mrcc = ExecuteSQL(txtSQL, MsgText)
txtSQL = "select * from gradecourse_Info "
Set mrcc = ExecuteSQL(txtSQL, MsgText)
For i = 1 To listSelectcourse.ListCount
mrcc.AddNew
mrcc.Fields(0) = comboGrade.Text
mrcc.Fields(1) = listSelectcourse.List(i - 1)
mrcc.Update
Next i
mrcc.Close
MsgBox "课程设置成功!", vbOKOnly + vbExclamation, "警告"
End If
End Sub
Private Sub cmdSet_Click()
Dim mrc As ADODB.Recordset
Dim txtSQL As String
Dim MsgText As String
listAllcourse.Enabled = True
listSelectcourse.Enabled = True
cmdModify.Enabled = True
txtSQL = "select * from course_Info "
Set mrc = ExecuteSQL(txtSQL, MsgText)
While (mrc.EOF = False)
listAllcourse.AddItem mrc.Fields(1)
mrc.MoveNext
Wend
mrc.Close
flagSet = True
End Sub
Private Sub comboGrade_Click()
Dim mrc As ADODB.Recordset
Dim txtSQL As String
Dim MsgText As String
Dim i As Integer
listSelectcourse.Clear
txtSQL = "select * from gradecourse_Info where grade = '" & comboGrade.Text & "'"
Set mrc = ExecuteSQL(txtSQL, MsgText)
If Not mrc.EOF Then
For i = 1 To mrc.RecordCount
listSelectcourse.AddItem mrc.Fields(1)
mrc.MoveNext
Next i
End If
mrc.Close
End Sub
Private Sub Form_Load()
flagSet = False
flagGrade = False
listAllcourse.Enabled = False
listSelectcourse.Enabled = False
cmdModify.Enabled = False
comboGrade.AddItem "初中一年级"
comboGrade.AddItem "初中二年级"
comboGrade.AddItem "初中三年级"
comboGrade.AddItem "高中一年级"
comboGrade.AddItem "高中二年级"
comboGrade.AddItem "高中三年级"
End Sub
Private Sub listAllcourse_Click()
If listAllcourse.ListIndex <> -1 Then
listSelectcourse.ListIndex = -1
End If
End Sub
Private Sub listSelectcourse_Click()
If listSelectcourse.ListIndex <> -1 Then
listAllcourse.ListIndex = -1
End If
End Sub
.........................................................................................................
........................... frmInquiresinfo 查询学籍信息窗口代码 .................................
Private Sub cmdExit_Click()
Unload Me
End Sub
Private Sub cmdInquire_Click()
Dim txtSQL As String
Dim MsgText As String
Dim dd(4) As Boolean
Dim mrc As ADODB.Recordset
txtSQL = "select * from student_Info where "
If Check1(0).Value Then
If Trim(txtSID.Text) = "" Then
sMeg = "学号不能为空"
MsgBox sMeg, vbOKOnly + vbExclamation, "警告"
txtSID.SetFocus
Exit Sub
Else
If Not IsNumeric(Trim(txtSID.Text)) Then
MsgBox "请输入数字!", vbOKOnly + vbExclamation, "警告"
<< 上一页 [21] [22] [23] [24] [25] [26] [27] [28] [29] 下一页