学生信息管理系统是典型的信息管理系统(MIS),其开发主要包括后台数据库的建立和维护以及前端应用程序的开发两个方面。对于前者要求建立起数据一致性和完整性强、数据安全性好的库。而对于后者则要求应用程序功能完备,易使用等特点。
本系统主要完成对学生情况和学生成绩的管理,包括数据库中表的添加、修改、删除等。系统还可以完成对各类信息的浏览、查询、添加、删除、修改、报表等功能。
系统的核心是数据库中各个表联系,每一个表的修改都将联动的影响其它的表,当完成对数据的操作时系统会自动地完成数据库的修改。查询功能也是系统的核心之一,在系统中即有单条件查询和多条件查询,也有精确查询和模糊查询,系统不仅有静态的条件查询,也有动态生成的条件查询,其目的都是为了方便用户使用。系统有完整的用户添加、删除和密码修改功能,并具备报表打印功能。
经过分析,我们使用 MICROSOFT公司的 VISUAL BASIC开发工具,利用其提供的各种面向对象的开发工具,尤其是数据窗口这一能方便而简洁操纵数据库的智能化对象,首先在短时间内建立系统应用原型,然后,对初始原型系统进行需求迭代,不断修正和改进,直到形成用户满意的可行系统。
关键字:管理信息系统、数据库、vb6.0、access2000。
ABSTRACT
Student status management system is development two aspects that typical information management system, IMS( MIS), its development includes primarily the background database creates with support and the front end applies the procedure.Creates to rise to the former request the consistency of data is strong with the integrity, the library that the safeness of data like.But request the latter very much to apply the procedure function complete, easy usage etc. characteristics.
This system completes primarily to student's circumstance with the management of student's score, include the database the inside the watch increase, modify, delete etc..The system can also complete to the browsing of various information, search, increase, delete, modify, report etc. function.
System of nucleus is other table in an influence for of relation, each a modification of watch moving in a table in database that modification that operation hour system, be to complete the logarithms according to will complete the database of oneself.Search the function is also one of the nucleus of the system, having namely in system the single condition search to search with many conditions, also having the accurate search to search with blur, system not only contain static condition search, also have the dynamic born condition search, its purpose is all for the sake of the convenient consumer to use.System contain complete consumer increase, delete to modify the function with the password, the union has the report prints the function.
Through analysis, we use the MICROSOFT company VISUAL BASIC development tool, making use of its every kind of the tool of development that provide that face to the object, particularly is intelligence that the window of data this on canning be convenient but manipulate the database in brief to turn the object, create in the in a short time first system application prototype, then, start to the beginning the prototype system proceeds to require with the iteration, revising continuously with improve, until forming the consumer is satisfied can row system.
Keywords: MIS, database, vb6.0, access2000.
3.2.3 主界面
“主界面”包括菜单和经过处理的图片组成。在各个菜单中包含子菜单,各个菜单里添加显示其功能的窗体的代码,并且使“主界面”的enabled属性为true(主界面可用)。
在Form_Load()中根添加代码,是登录用的根据用户的级别限制某些菜单可用或者不可用。UserType = True为超级用户,否则为一般用户。如果是一般用户系统管理、信息录入、打印报表菜单将不可用。
在Form_QueryUnload添加代码,就是退出的时候释放掉所有窗口的资源免得造成内存泄漏,cn.Close是关闭ADO连接,For Each frm In Forms是销毁所有窗口。
3.2.4 基本信息录入
本界面包括14个label控件,12个textbox控件,5个combo控件,12个commandbutton控件,一个datagrid控件和一个Timer控件。通过combo可以选择具体表,datagrid可以显示选择表,14个label分别为“学号”、姓名、性别、父母姓名、出生年月、地址、邮政编码、班级、专业、院系、电话号码、附注,12个button分别是“第一个”、前一个、下一个、最后、修改(对基本信息)、更新、取消修改、删除(对基本信息)、添加、修改(对成绩)、删除(对成绩)、关闭。定义全局变量Option Explicit
Dim rs As ADODB.Recordset
Dim rs1 As ADODB.Recordset
Dim txtSQL As String
Dim MsgText As String
Dim mybookmark As Variant
Dim mcclean As Boolean。
在Timer1_Timer中添加代码对变量db,rs进行初始化,db连接数据库,rs打开“课程表”表。在combo中用方法combo4.additem选择数据库中的课程号和课程名。Combo3中添加文本"优异"、"良好"、"中等"、"及格"、"不及格"。循环rs.recordcount次,在combo2中用方法combo2.additem添加文本rs.fields,rs记录集使用方法rs.Fields(0)打开文件中的记录。这样combo中有所有的信息,管理员可以任意选择想对应的课程和课程号。
在command1_click(添加)中添加代码。在这里用到了多个IF条件语句可以添加学生的成绩,课程号(Combo4)和课程名称(Combo2)在数据库已给出对并建立的连接,Adodc1.Recordset.Update MsgBox "添加成功!" Else MsgBox "备注不能为空,请输入备注!"。添加的成绩可以在DataGrid2显示出来。
在command7_click(修改(对成绩))中添加代码。Set rs = cn.Execute("select 成绩 from 学生与课程 where 课程号='" & Trim(Combo1.Text) & "' and 课程名称='" & Trim(Combo2.Text) & "' and 学号='" & Trim(Text2.Text) & "' "),根据变量rs的属性rs.state 判断rs是否已经存在,如果已存在,设置datagrid的属性datagrid2.enabled(由于已经设置了rs的属性所以datagrid支持修改);如果不存在则根据各个IF条件语句msgbox给出提示“成绩和备注不匹配,请核对!”、“没有该课程成绩,不能修改!”、“ 该项不能为空,请输入备注!”、“ 该项不能为空,请输入课程名称!”、“ 该项不能为空,请输入课程号!”、“ 该项不能为空,请输入成绩!”。
在command8_click(删除)中添加代码。输入以给成绩的课程号和课程名称,根据变量rs的属性rs.state 判断rs是否已经存在,调用rs的方法rs.delete;给出提示 If MsgBox("你的操作将会删除当前的纪录,你确信吗?),rs1.Close MsgBox "没有这条记录,无法删除!"。
在command9_click(关闭)中添加代码。显示“主界面”,隐藏本界面,关闭rs集合,断开db连接。
在command2_click(第一个)中添加代码。用go to语句跳转第一条学生学生信息的基本信息。
在command3_click(最后)中添加代码。用go to语句
Adodc2.Recordset.MoveLast跳转最后一条信息。
在command4_click(下一个)中添加代码。Adodc2.Recordset.MoveNext 转到下一条信息。
在command5_click(前一个)中添加代码。Adodc2.Recordset.MovePrevious go to语句转到前一条信息。
在command6_click(修改(对基本信息))中添加代码。使Command2、Command3、Command4、Command5、Command10的Enabled为False,text1致text12、Combo1和DataCombo1为True。
在CmdUpdata_Click(更新)中添加代码。更新是用于修改之后,使用IF条件语句,根据条件设置MsgBox,给出提示提示("请先修改学生信息信息"),若有信息示输入,提示("请输入学号!")………。
在CmdBolish_Click(取消修改)中添加代码。使Command2、Command3、Command4、Command5、Command10的Enabled为true,text1致text12、Combo1和DataCombo1为False。MsgBox "什么也没修改,无所谓取消不取消!"。
在command10_click(删除(对基本信息))中添加代码。MsgBox Err.Description 提示(“你确信删除吗?”)。选是删除当前的一条记录。
3.2.5 成绩录入
成绩录入模块的界面包括五个个label控件,四个command控件,三个combo控件,两个adodc控件。Label主要起提示作用,command的caption属性分别为“添加”,“更改”,“删作”,“退出”。定义全局变量Dim rs As New ADODB.Recordset,设置db,rs,db1,rs1的属性为可以修改。
在Command1(添加)中添加代码。使用八个IF条件语句设置各种条件,若符合条件则提示“添加成功!”否则谈出各种不匹配的窗口。
在Command2(更改)中添加代码。Set rs = cn.Execute("select 成绩 from 学生与课程 where 课程号='" & Trim(Combo1.Text) & "' and 课程名称='" & Trim(Combo2.Text) & "' and 学号='" & Trim(Text2.Text) & "' "),课程号和课程名称必须匹配,同样用到多个IF条件语句,例如成绩为80分的,备注中不能选不及格,MsgBox 提示"成绩和备注不匹配,请核对!" 。
在Command3(删除)中添加代码。If MsgBox("你的操作将会删除当前的纪录,你确信吗?", vbOKCancel, "警告") = vbOK Then,信息必须与学生信息信息相同才能删除学生成绩。若没有记录则提示“没有这条记录,无法删除!” 。rs.Open 打开数据库中的连接(用来连接课程号和课程名)
在Command4(退出)中添加代码。Unload Me 退出连接,显示“主界面”。