您的位置:首页 > 其它

学生信息管理系统之 查询学籍信息流程

2013-08-10 19:10 579 查看
一:查询学籍信息的一个界面









二整理的流程图。









三:画完流程图真的感觉思路清晰了很多。磨刀不误砍柴工,走好每一步。



附源代码如下:

DimtxtSQLAsString
DimMsgTextAsString
Dimdd(4)AsBoolean
DimmrcAsADODB.Recordset

txtSQL="select*fromresult_Infowhere"
IfCheck1(0).ValueThen'第一个复选框被选中
IfTrim(txtSID.Text)=""Then
sMeg="学号不能为空"
MsgBoxsMeg,vbOKOnly+vbExclamation,"警告"
txtSID.SetFocus
ExitSub
Else
IfNotIsNumeric(Trim(txtSID.Text))Then
MsgBox"请输入数字!",vbOKOnly+vbExclamation,"警告"
ExitSub
txtSID.SetFocus
EndIf
dd(0)=True
txtSQL=txtSQL&"student_ID='"&Trim(txtSID.Text)&"'"
EndIf
EndIf

IfCheck1(1).ValueThen
IfTrim(txtName.Text)=""Then
sMeg="姓名不能为空"
MsgBoxsMeg,vbOKOnly+vbExclamation,"警告"
txtName.SetFocus
ExitSub
Else
dd(1)=True
Ifdd(0)Then
txtSQL=txtSQL&"andstudent_Name='"&txtName.Text&"'"
Else
txtSQL=txtSQL&"student_Name='"&txtName.Text&"'"
EndIf
EndIf
EndIf

IfCheck1(2).ValueThen
IfTrim(txtCourse.Text)=""Then
sMeg="课程不能为空"
MsgBoxsMeg,vbOKOnly+vbExclamation,"警告"
txtCourse.SetFocus
ExitSub
Else
dd(2)=True
Ifdd(0)Ordd(1)Then
txtSQL=txtSQL&"andcourse_Name='"&txtCourse.Text&"'"
Else
txtSQL=txtSQL&"course_Name='"&txtCourse.Text&"'"
EndIf
EndIf
EndIf

IfNot(dd(0)Ordd(1)Ordd(2)Ordd(3))Then
MsgBox"请设置查询方式!",vbOKOnly+vbExclamation,"警告"
ExitSub
EndIf

txtSQL=txtSQL&"orderbystudent_ID"
Setmrc=ExecuteSQL(txtSQL,MsgText)

Withmyflexgrid
.Rows=2
.CellAlignment=4
.TextMatrix(1,0)="考试编号"
.TextMatrix(1,1)="学号"
.TextMatrix(1,2)="姓名"
.TextMatrix(1,3)="班号"
.TextMatrix(1,4)="课程名称"
.TextMatrix(1,5)="分数"


DoWhileNotmrc.EOF
.Rows=.Rows+1
.CellAlignment=4
.TextMatrix(.Rows-1,0)=mrc.Fields(0)
.TextMatrix(.Rows-1,1)=mrc.Fields(1)
.TextMatrix(.Rows-1,2)=mrc.Fields(2)
.TextMatrix(.Rows-1,3)=mrc.Fields(3)
.TextMatrix(.Rows-1,4)=mrc.Fields(4)
.TextMatrix(.Rows-1,5)=mrc.Fields(5)
mrc.MoveNext
Loop

EndWith

mrc.Close
EndSub






内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: