学生信息管理系统(总体设计)1、管理系统功能模块设计本系统需要完成的功能主要有:(1)、输入学生基本信息、所在班级、所学课程和成绩等。
(2)、学生信息的查询,包括查询学生基本信息、所在班级、已学课程和成绩等。
(3)、学生信息的修改。
(4)、班级信息的输入,包括输入班级设置、年级信息等。
(5)、班级信息的查询。
(6)、班级信息的修改。
(7)、班级课程信息的输入。
(8)、班级课程信息的修改。
(9)、学生课程添加和修改。
(10)、学生成绩信息的输入。
(11)、学生成绩信息的修改。
(12)、学生成绩信息的查询。
(13)、学生成绩信息的统计。
2、功能模块设计:3、数据库设计:学生信息管理系统(需求分析)1.系统开发背景分析系统的功能取决开用户的需求。
随着科技进步和信息时代的到来,教育的普及程度起来起高,学校的人数也在迅速的增长,怎样的管理好成千上万的学生,已经成为一个学校的管理者必须面对的问题。
编写本报告的目的就是用最少的代价,尽可能短的时间内确定问题是否能够解决,通过对学校的一些管理软件的调研分析,发现了一些不足,所以拟做此系统,使学生信息的管理更加准确,安全和快捷。
在本次试验中包括的模块有学生信息管理、课程信息管理、成绩信息管理和班级信息管理等几项,各项管理工作涉及到的内容用下面的关系模式表示。
a)学生(学号,姓名,性别,年龄,班级,电话,备注,出生日期,入学时间,班级编号,家庭地址)b)课程(课程编号,课程名称,课程类别,学分,学时)c)班级(系,班级号,指导老师)2.系统分析1.抽象出当前系统的逻辑模型画出反映当前系统工作的数据流程图。
数据流程图是逻辑模型的图形表示,即使不是专业的计算机技术人员也能非常容易理解,它是一种很好的系统构造的表示方法。
画数据流程图是应该从已获得的人工处理流程中去掉物理因素,只保留数据、信息处理部分。
2.系统功能分析系统主要用于学校学生信息管理,主要任务是用计算机对学生各种信息进行日常管理,如:查询、修改、增加、删除。
3.系统目标设计根据本校的实际情况,利用校园网而设计一套针对性和功能都比较强的学生信息管理系统,对学生信息管理系统进行科学的分类、录入、查询.4.开发设计思想尽量采用学校现有的软硬件环境及先进的管理系统开发方案,从而达到充分利用资源,提高系统开发的水平和应用效果的目的。
系统应该符合学校学生信息管理的规定,满足学校学生日常管理的需要,达到操作过程中的直观、方便、实用、安全等要求。
强调多部门合作,学生工作设计面广泛,应该考虑各部门各层次的需求,便于维护。
要建立可靠的数据备份。
通过对数据流程图的进一步分析,得出学生信息管理系统应该具备以下功能:1、实现学生基本信息的登记2、实现数据的浏览与修改3、实现查询符合一定条件的资料4、实现学生有关数据的统计分析5.E-R图6.数据流程图7.数据字典学生信息管理系统(实现、调试、运行)编码1、登录模块代码:Option ExplicitPrivate Sub cmd3_Click()Dim cn As ADODB.ConnectionDim rs As ADODB.RecordsetDim str_cn As String '访问sql server的连接字符串Dim str_sql As Stringstr_cn = "driver={sql server};server=.;uid=sa;pwd=;database=student" Set cn = New ADODB.Connectioncn.CursorLocation = adUseClientcn.Open str_cn '连接sql serverstr_sql = "select * from user_info where user_name='" & Text1.Text & "' and user_code='" & Text2.Text & "'"Set rs = New ADODB.Recordsetrs.Open str_sql, cn, adOpenDynamic, adLockOptimisticIf Len(Text1.Text) = 0 ThenMsgBox "请输入用户名!", 64, "提示"Text1.SetFocusElseIf Len(Text2.Text) = 0 ThenMsgBox "请输入密码!", 64, "提示"Text2.SetFocusElseIf rs.RecordCount = 0 Theni = MsgBox("不存在该用户,是否立即注册?", 4 + 32, "提示") If i = 6 ThenUnload MeForm3.ShowElsemdlTextBox.Blank MeText2.SetFocusEnd IfElse' Unload MeForm1.HideForm4.ShowEnd IfEnd IfEnd SubPrivate Sub Form_Load()mdlTextBox.Centen Me '使窗体居中End SubPrivate Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)Label5.ForeColor = vbBlackLabel5.FontUnderline = FalseLabel6.ForeColor = vbBlackLabel6.FontUnderline = FalseEnd SubPrivate Sub Label5_Click()Unload MeForm3.ShowEnd SubPrivate Sub Label5_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)Label5.ForeColor = vbBlueLabel5.FontUnderline = TrueEnd SubPrivate Sub Label6_Click()Unload MeForm2.ShowEnd SubPrivate Sub Label6_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)Label6.ForeColor = vbBlueLabel6.FontUnderline = TrueEnd Sub2、添加学生信息代码:Option ExplicitPrivate Sub Command1_Click()If Len(Text1.Text) = 0 Or Len(Text6.Text) = 0 ThenMsgBox "请将信息补充完整!", 48, "警告"Exit SubEnd If'添加新记录sqlstr = "select * from student_Info"Set rs = ExecuteSQL(sqlstr, Msg)rs.AddNewrs.Fields("student_id") = Text6.Textrs.Fields("student_name") = Text1.Textrs.Fields("class_no") = Combo2.Textrs.Fields("born_date") = Text2.Textrs.Fields("student_sex") = Combo1.Textrs.Fields("address") = Text4.Textrs.Fields("tele_number") = Text7.Textrs.Fields("comment") = Text5.Textrs.Fields("ru_date") = Text3.Textrs.Updaters.CloseMsgBox "学生信息添加完成!", 48, "提示信息"mdlTextBox.Blank MeEnd SubPrivate Sub Command2_Click()Unload MeForm4.ShowEnd SubPrivate Sub Form_Load()mdlTextBox.Centen MemdlTextBox.Blank MeCombo1.Text = "男": Combo2.Text = ""Combo1.AddItem "男"Combo1.AddItem "女"sqlstr = "select * from class_Info"Set rs = ExecuteSQL(sqlstr, Msg)For i = 1 To rs.RecordCountCombo2.AddItem rs.Fields(0)rs.MoveNextNext irs.CloseEnd Sub3、删改学生信息代码:Option ExplicitPrivate Sub Command4_Click()'从数据库中读取学生信息并添加到窗体中的输入框sqlstr = "select * from student_Info where student_id='" & Combo2.Text & "' and class_no='" & Combo1.Text & "'"Set rs = ExecuteSQL(sqlstr, Msg)If rs.RecordCount = 0 ThenMsgBox "没有找到符合条件的数据!", 48, "警告"mdlTextBox.Blank Me: Combo3.Text = ""ElseText2.Text = Trim(rs.Fields("student_id"))Text1.Text = Trim(rs.Fields("student_name"))Text3.Text = Trim(rs.Fields("born_date"))Combo3.Text = Trim(rs.Fields("class_no"))Combo4.Text = Trim(rs.Fields("student_sex"))Text4.Text = Trim(rs.Fields("tele_number"))Text5.Text = Trim(rs.Fields("address"))Text6.Text = Trim(rs.Fields("comment"))Text7.Text = Trim(rs.Fields("ru_date"))End Ifrs.CloseEnd SubPrivate Sub Command1_Click()Dim cn As ADODB.Connectionsqlstr = "update student_info set student_name='" & Text1.Text & "',born_date= ' " & Text3.Text & " ' ,student_sex='" & Combo4.Text & "',class_no='" & Combo1.Text & "',tele_number='" & Text4.Text & "',address='" & Text5.Text & "',comment='" & Text6.Text & "',ru_date='" & Text7.Text & "' where student_id='" & Combo2.Text & "'"On Error GoTo exitsubSet cn = New ADODB.Connectioncn.Open connstrcn.Execute sqlstrMsgBox "成功修改数据!!"exitsub:cn.ClosemdlTextBox.Blank Me: Combo3.Text = ""End SubPrivate Sub Command2_Click()Dim cn As ADODB.Connectionsqlstr = "delete from student_info where student_id='" & Combo2.Text & "'"On Error GoTo exitsubSet cn = New ADODB.Connectioncn.Open connstrcn.Execute sqlstrMsgBox "成功删除数据!!"exitsub:cn.ClosemdlTextBox.Blank Me: Combo3.Text = "" End SubPrivate Sub Command3_Click()Unload MeForm4.ShowEnd SubPrivate Sub Form_Load()mdlTextBox.Centen MeCombo1.Text = "": Combo2.Text = "" mdlTextBox.Blank MeCombo3.Text = ""Combo4.Text = "男"Combo4.AddItem "男"Combo4.AddItem "女"Dim sqlstr As StringDim Msg As StringDim i As Integersqlstr = "select * from class_Info" Set rs = ExecuteSQL(sqlstr, Msg)For i = 1 To rs.RecordCountCombo1.AddItem rs.Fields(0)Combo3.AddItem rs.Fields(0)rs.MoveNextNextDim sql As StringDim msgtext As Stringsql = "select * from student_Info"Set rs = ExecuteSQL(sql, msgtext)For i = 1 To rs.RecordCountCombo2.AddItem rs.Fields(0)rs.MoveNextNextrs.CloseEnd Sub4、查询学生信息:Option ExplicitPrivate Sub Command1_Click()Dim rs As New ADODB.RecordsetDim cn As New ADODB.ConnectionDim cnstr As Stringcnstr = "driver={sql server};server=.;uid=sa;pwd=;database=student" cn.Open cnstrIf Option1.Value = True Thensqlstr = "select * from student_info"Combo1.Text = ""Text1.Text = "": Text2.Text = ""End IfIf Option2.Value = True Thensqlstr = "select * from student_info where class_no='" & Combo1.Text & "' "Text2.Text = "": Text1.Text = ""End IfIf Option3.Value = True Thensqlstr = "select * from student_info where student_id='" & Text1.Text & "' "Combo1.Text = "": Text2.Text = ""End IfIf Option4.Value = True Thensqlstr = "select * from student_info where student_name='" & Text2.Text & "'"Combo1.Text = "": Text2.Text = ""End Ifrs.Open sqlstr, cnSet rs = ExecuteSQL(sqlstr, Msg)If rs.RecordCount = 0 ThenMsgBox "没有查找到满足条件的数据!", 48, "提示"fgStudent.Rows = 1ElsefgStudent.Rows = rs.RecordCount + 1fgStudent.Cols = 9'设定行高For i = 0 To fgStudent.Rows - 1fgStudent.RowHeight(i) = 280Next i'设定列的属性fgStudent.Row = 0For i = 0 To fgStudent.Cols - 1fgStudent.Col = i '指定当前列为第I 列fgStudent.FixedAlignment(i) = 4 '使内容居中Select Case iCase 0fgStudent.ColWidth(i) = 1500 '设定列宽fgStudent.Text = "学号"Case 1fgStudent.ColWidth(i) = 2000 '设定列宽fgStudent.Text = "姓名"Case 2fgStudent.ColWidth(i) = 800 '设定列宽fgStudent.Text = "性别"Case 3fgStudent.ColWidth(i) = 800 '设定列宽fgStudent.Text = "班级"Case 4fgStudent.ColWidth(i) = 1300 '设定列宽fgStudent.Text = "出生日期"Case 5fgStudent.ColWidth(i) = 1500 '设定列宽fgStudent.Text = "电话"Case 6fgStudent.ColWidth(i) = 1500fgStudent.Text = "入学时间"Case 7fgStudent.ColWidth(i) = 2500 '设定列宽fgStudent.Text = "地址"Case 8fgStudent.ColWidth(i) = 3000 '设定列宽fgStudent.Text = "备注信息"End SelectNext ii = 1 '从第二行开始显示内容While (Not rs.EOF)fgStudent.Row = iFor j = 0 To fgStudent.Cols - 1fgStudent.Col = jfgStudent.CellAlignment = 4Select Case jCase 0fgStudent.Text = rs.Fields("student_id") Case 1fgStudent.Text = rs.Fields("student_name") Case 2fgStudent.Text = rs.Fields("student_sex") Case 3fgStudent.Text = rs.Fields("class_no")Case 4fgStudent.Text = rs.Fields("born_date")Case 5fgStudent.Text = rs.Fields("tele_number") Case 6fgStudent.Text = rs.Fields("ru_date")Case 7fgStudent.Text = rs.Fields("address")Case 8fgStudent.Text = rs.Fields("comment")End SelectNext jrs.MoveNexti = i + 1WendEnd Ifrs.CloseEnd SubPrivate Sub Command2_Click()Unload MeForm4.ShowEnd SubPrivate Sub Form_Load()mdlTextBox.Centen MeText1.Text = "": Text2.Text = "": Combo1.Text = ""Dim rs As ADODB.Recordsetsqlstr = "select * from class_info"Set rs = ExecuteSQL(sqlstr, Msg)For i = 1 To rs.RecordCountCombo1.AddItem rs.Fields(0)rs.MoveNextNextrs.CloseEnd Sub程序运行界面:学生信息管理系统(详细设计)登录的系统界面:总体程序流程图:学校构成系部开始课程选课成绩构成教师授课构成班级构成学生。