《VB+SQL》综合实训-学生信息管理系统.doc_第1页
《VB+SQL》综合实训-学生信息管理系统.doc_第2页
《VB+SQL》综合实训-学生信息管理系统.doc_第3页
《VB+SQL》综合实训-学生信息管理系统.doc_第4页
《VB+SQL》综合实训-学生信息管理系统.doc_第5页
已阅读5页,还剩36页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

此文档收集于网络,如有侵权,请联系网站删除湖北轻工职业技术学院信息工程系VB+SQL综合实训设计题目:学生信息管理班 级:10计管 姓 名: 学 号: 指导教师: 日 期:201112 一设计题目学生信息管理系统二系统功能说明(1)系统功能分析:学生信息管理系统需要完成的功能主要有:l 有关学籍信息的输入,包括学生基本信息、所在班级、所学课程和成绩信息;l 学生信息的查询,包括学生基本信息、所在班级、已学课程和成绩等;l 学生信息的修改;l 班级管理信息的输入,包括班级设置、年级信息等;l 班级管理信息的查询;l 班级管理信息的修改;l 学校基本课程信息的输入;l 学校基本课程信息的修改;l 学生课程的设置和修改;l 学生成绩信息的输入;l 学生成绩信息的修改;l 学生成绩信息的查询;l 学生成绩信息的统计。(2)系统功能模块设计对上述各项功能进行集中,分块,按照结构化程序设计的要求,得到如下图所示的系统功能模块图。三 数据库需求分析数据库在一个信息管理系统中占有非常重要的地位,数据库结构设计的好坏将直接对应系统的效率以及实现的效果产生影响。合理的数据库结构设计可以提高数据存储的效率,保证数据的完整和一致。同时,合理的数据库结构也将有利于程序的实现。设计数据库系统时应该首先了解用户各个方面的需求,包括现有的以及将来可能增加的需求。用户的需求具体体现在各种信息的提供、保存、更新和查询,这就要求数据库结构能充分满足各种信息的输出和输入。收集基本数据、数据结构以及数据处理的流程,组成一份详尽的数据字典,为后面的具体设计打下基础。四、在实现这个过程的时候,需要用到如下的一些表格:1.系统用户表:(字段如下)2.学生基本信息表:(字段如下)3.学生成绩表:(字段如下)4.年级基本课程表:(字段如下)5.课程表:(字段如下)6. 班级基本信息表:(字段如下)五各项功能的流程图(1)学生信息管理系统基本信息输入学生注册学籍信息管理成绩信息输入成绩信息管理班级设置班级管理课程基本信息班级课程设置班级课程管理(2)学生实体学号姓名性别出生日期学生班号入校日期家庭住址联系电话(3)班级实体班级班号年级班主任所在教室(4)课程实体课程课程号课程名课程类型课程描述(5)年级实体年级年级名称包括班级设置课程(6)实体之间的关系学生班级设置班级年级设置年级课程设置考核过程课程六程序清单1.主模块代码:Private Sub 查询成绩信息_Click() frmAddresult.Show Unload frmInquiresinfo Unload frmLogin Unload frmsetCourseinfo Unload frmAddclassinfo Unload frmAddcourseinfo Unload frmAddsinfo Unload frmadduser Unload frmModifyclassinfo Unload frmModifyresultinfo Unload frmModifycourseinfo Unload frmModifyuserinfo Unload frmModifyinfo Unload frmAddresultinfoEnd SubPrivate Sub 查询学籍信息_Click() frmInquiresinfo.Show Unload frmAddresultinfo Unload frmLogin Unload frmsetCourseinfo Unload frmAddclassinfo Unload frmAddcourseinfo Unload frmAddsinfo Unload frmadduser Unload frmModifyclassinfo Unload frmModifyresultinfo Unload frmModifycourseinfo Unload frmModifyuserinfo Unload frmModifyinfo Unload frmAddresultinfoEnd SubPrivate Sub 登录用户_Click() frmLogin.Show Unload frmAddresult Unload frmInquiresinfo Unload frmsetCourseinfo Unload frmAddclassinfo Unload frmAddcourseinfo Unload frmAddsinfo Unload frmadduser Unload frmModifyclassinfo Unload frmModifyresultinfo Unload frmModifycourseinfo Unload frmModifyuserinfo Unload frmModifyinfo Unload frmAddresultinfoEnd SubPrivate Sub 设置年级信息_Click() frmsetCourseinfo.Show Unload frmAddresultinfo Unload frmInquiresinfo Unload frmLogin Unload frmAddclassinfo Unload frmAddcourseinfo Unload frmAddsinfo Unload frmadduser Unload frmModifyclassinfo Unload frmModifyresultinfo Unload frmModifycourseinfo Unload frmModifyuserinfo Unload frmModifyinfo Unload frmAddresultinfoEnd SubPrivate Sub 添加班级信息_Click() frmAddclassinfo.Show Unload frmAddresult Unload frmInquiresinfo Unload frmLogin Unload frmsetCourseinfo Unload frmAddcourseinfo Unload frmAddsinfo Unload frmadduser Unload frmModifyclassinfo Unload frmModifyresultinfo Unload frmModifycourseinfo Unload frmModifyuserinfo Unload frmModifyinfo Unload frmAddresultinfoEnd SubPrivate Sub 添加成绩信息_Click() frmAddresultinfo.Show Unload frmInquiresinfo Unload frmLogin Unload frmsetCourseinfo Unload frmAddclassinfo Unload frmAddcourseinfo Unload frmAddsinfo Unload frmadduser Unload frmModifyclassinfo Unload frmModifyresultinfo Unload frmModifycourseinfo Unload frmModifyuserinfo Unload frmModifyinfo Unload frmAddresultEnd SubPrivate Sub 添加课程信息_Click() frmAddcourseinfo.Show Unload frmAddresultinfo Unload frmInquiresinfo Unload frmLogin Unload frmsetCourseinfo Unload frmAddclassinfo Unload frmAddsinfo Unload frmadduser Unload frmModifyclassinfo Unload frmModifyresultinfo Unload frmModifycourseinfo Unload frmModifyuserinfo Unload frmModifyinfo Unload frmAddresultEnd SubPrivate Sub 添加学籍信息_Click() frmAddsinfo.Show frmAddresultinfo.Show Unload frmInquiresinfo Unload frmLogin Unload frmsetCourseinfo Unload frmAddclassinfo Unload frmAddcourseinfo Unload frmadduser Unload frmModifyclassinfo Unload frmModifyresultinfo Unload frmModifycourseinfo Unload frmModifyuserinfo Unload frmModifyinfo Unload frmAddresultEnd SubPrivate Sub 添加用户_Click() frmadduser.Show Unload frmAddresultinfo Unload frmInquiresinfo Unload frmLogin Unload frmsetCourseinfo Unload frmAddclassinfo Unload frmAddcourseinfo Unload frmAddsinfo Unload frmModifyclassinfo Unload frmModifyresultinfo Unload frmModifycourseinfo Unload frmModifyuserinfo Unload frmModifyinfo Unload frmAddresultEnd SubPrivate Sub 修改班级信息_Click() frmModifyclassinfo.Show Unload frmAddresultinfo Unload frmInquiresinfo Unload frmLogin Unload frmsetCourseinfo Unload frmAddclassinfo Unload frmAddcourseinfo Unload frmAddsinfo Unload frmadduser Unload frmModifyresultinfo Unload frmModifycourseinfo Unload frmModifyuserinfo Unload frmModifyinfo Unload frmAddresultEnd SubPrivate Sub 修改成绩信息_Click() frmModifyresultinfo.Show Unload frmAddresultinfo Unload frmInquiresinfo Unload frmLogin Unload frmsetCourseinfo Unload frmAddclassinfo Unload frmAddcourseinfo Unload frmAddsinfo Unload frmadduser Unload frmModifyclassinfo Unload frmModifycourseinfo Unload frmModifyuserinfo Unload frmModifyinfo Unload frmAddresultEnd SubPrivate Sub 修改课程信息_Click() frmModifycourseinfo.Show Unload frmAddresultinfo Unload frmInquiresinfo Unload frmLogin Unload frmsetCourseinfo Unload frmAddclassinfo Unload frmAddcourseinfo Unload frmAddsinfo Unload frmadduser Unload frmModifyclassinfo Unload frmModifyresultinfo Unload frmModifyuserinfo Unload frmModifyinfo Unload frmAddresultEnd SubPrivate Sub 修改密码_Click() frmModifyuserinfo.Show Unload frmAddresultinfo Unload frmInquiresinfo Unload frmLogin Unload frmsetCourseinfo Unload frmAddclassinfo Unload frmAddcourseinfo Unload frmAddsinfo Unload frmadduser Unload frmModifyclassinfo Unload frmModifyresultinfo Unload frmModifycourseinfo Unload frmModifyinfo Unload frmAddresultEnd SubPrivate Sub 修改学籍信息_Click() frmModifyinfo.Show Unload frmAddresultinfo Unload frmInquiresinfo Unload frmLogin Unload frmsetCourseinfo Unload frmAddclassinfo Unload frmAddcourseinfo Unload frmAddsinfo Unload frmadduser Unload frmModifyclassinfo Unload frmModifyresultinfo Unload frmModifycourseinfo Unload frmModifyuserinfo Unload frmAddresultEnd Sub2.系统用户模块的创建:A、用户添加如下的过程:实现用户的注册,在这个窗体中放置三个文本框,用来输入用户名和密码,两个按钮用来确定是否添加用户,如下图所示:实现这个过程的代码如下:Private Sub CmdCancel_Click() Unload MeEnd SubPrivate Sub CmdOK_Click()Dim txtSQL As StringDim mrc As ADODB.RecordsetDim MsgText As StringIf Trim(Text1(0).Text) = Then MsgBox 请输入用户名称!, vbOKOnly + vbExclamation, 警告 Exit Sub Text1(0).SetFocusElse txtSQL = select * from user_Info Set mrc = ExecuteSQL(txtSQL, MsgText) While (mrc.EOF = False) If Trim(mrc.Fields(0) = Trim(Text1(0) Then MsgBox 用户已经存在,请重新输入用户名, vbOKOnly + vbExclamation, 警告 Text1(0).SetFocus Text1(0).Text = Text1(1).Text = Text1(2).Text = Exit Sub Else mrc.MoveNext End If WendEnd IfIf Trim(Text1(1).Text) Trim(Text1(2).Text) Then MsgBox 两次输入的密码不一致,请确认!, vbOKOnly + vbExclamation, 警告 Text1(1).SetFocus Text1(1).Text = Text1(2).Text = Exit SubElse If Text1(1).Text = Then MsgBox 密码不能为空!, vbOKOnly + vbExclamation, 警告 Text1(1).SetFocus Text1(1).Text = Text1(2).Text = Else mrc.AddNew mrc.Fields(0) = Trim(Text1(0).Text) mrc.Fields(1) = Trim(Text1(1).Text) mrc.Update mrc.Close Me.Hide MsgBox 添加用户成功!, vbOKOnly + vbExclamation, 警告 End IfEnd IfEnd SubB、用户登录的过程: 用户登录窗体中放置了两个文本框(TextBoX),用来输入用户名和用户密码的,两个按钮(commandButton)用来确定或取消用户密码;三个标签用来标示窗体夫人信息,效果如下图所示:当密码和用户名正确的时候会进入如下的界面,但需要在其中输入这些代码才能实现: Option ExplicitPublic OK As BooleanDim miCount As IntegerPrivate Sub Form_Load() OK = False miCount = 0End SubPrivate Sub CmdOK_Click() Dim txtSQL As String Dim mrc As ADODB.Recordset Dim MsgText As StringUsername = If Trim(txtUserName.Text = ) Then MsgBox 没有这个用户,请重新输入用户名!, vbOKOnly + vbExclamation, 警告 txtUserName.SetFocus Else txtSQL = select * from user_Info where user_ID= & txtUserName.Text & Set rst = CN.Execute(select * from user_Info) Set mrc = ExecuteSQL(select * from user_Info, MsgText) If mrc.EOF Then MsgBox 没有这个用户,请重新输入用户名!, vbOKOnly + vbExclamation, 警告 txtUserName.SetFocus Else If Trim(mrc.Fields(1) = Trim(txtPassword.Text) Then OK = True mrc.Close Me.Hide Username = Trim(txtUserName.Text) Form2.Show Else MsgBox 输入密码不正确,请重新输入!, vbOKOnly + vbExclamation, 警告 txtPassword.SetFocus txtPassword.Text = End If End If End If miCount = miCount + 1 If miCount = 3 Then Me.Hide End If Exit SubEnd Sub 在这个窗体中所需的代码如下: Private Sub Command1_Click() frmInquiresinfo.Show Unload frmModifyinfo Unload frmAddsinfoEnd SubPrivate Sub Command2_Click() frmModifyinfo.Show Unload frmInquiresinfo Unload frmAddsinfoEnd SubPrivate Sub Command3_Click() frmAddsinfo.Show Unload frmInquiresinfo Unload frmModifyinfoEnd SubC、修改密码会以下的效果 这个窗体中放置了两个文本框,用来输入密码和确认密码的,两个按钮用来是否确认修改密码:,用两个文本框来标示文本框的内容: 如下图所示: 实现这个过程的代码如下: Private Sub CmdOK_Click() Dim txtSQL, MsgText As String Dim mrc As ADODB.Recordset If Trim(txtPassword1(0).Text) Trim(txtPassword1(1).Text) Then MsgBox 密码输入不正确!, vbOKOnly + vbExclamation, 警告 txtPassword1(0).SetFocus txtPassword1(0).Text = Else txtSQL = select * form user_Info where user_ID= & User_name & Set mrc = ExecuteSQL(txtSQL, MsgText) mrc.Fields(0) = txtPassword1(0).Text mrc.Update mrc.Close MsgBox 密码修改成功!, vbOKOnly + vbExclamation, 修改密码 Me.Hide End IfEnd Sub3.学籍管理模块的创建 学籍管理模块主要实现如下功能:l 添加学籍信息l 修改学籍信息l 查询学籍信息A、添加学籍信息窗体的创建: 选择“学籍管理”-“添加学籍信息”命令,弹出如下窗口:” 在窗体上放置的文本框个标签则是为用户提供输入数据的地方,按钮则是为为用户提供是否确定添加信息的;实现这个过程的代码如下: Private Sub Form_Load() Dim mrc As ADODB.Recordset Dim txtSQL As String Dim MsgText As String Dim i As Integer ComboGrader.AddItem 男 ComboGrader.AddItem 女 txtSQL = select * from class_Info Set mrc = ExecuteSQL(txtSQL, MsgText) For i = 1 To mrc.RecordCount txtComboClassNo.AddItem mrc.Fields(i) mrc.MoveNext Next i mrc.CloseEnd SubPrivate Sub CmdOK_Click()Dim mrc As ADODB.RecordsetDim txtSQL As StringDim MsgText As StringIf Not Testtxt(txtSID.Text) Then MsgBox 请输入学号!, vbOKOnly + vbExclamation, 警告 txtSID.SetFocus Exit Sub End IfIf Not Testtxt(txtName.Text) Then MsgBox 请输入姓名!, vbOKOnly + vbExclamation, 警告 txtName.SetFocus Exit Sub End IfIf Not Testtxt(ComboGrader.Text) Then MsgBox 请选择性别!, vbOKOnly + vbExclamation, 警告 ComboGrader.SetFocus Exit Sub End IfIf Not Testtxt(txtBorndate.Text) Then MsgBox 请输入出生日期!, vbOKOnly + vbExclamation, 警告 txtBorndate.SetFocus Exit Sub End IfIf Not Testtxt(txtComboClassNo.Text) Then MsgBox 请选择班号!, vbOKOnly + vbExclamation, 警告 txtComboClassNo.SetFocus Exit Sub End IfIf Not Testtxt(txtTel.Text) Then MsgBox 请输入电话!, vbOKOnly + vbExclamation, 警告 txtTel.SetFocus Exit Sub End IfIf Not Testtxt(txtRudate.Text) Then MsgBox 请输入入校时间!, vbOKOnly + vbExclamation, 警告 txtRudate.SetFocus Exit Sub End IfIf Not Testtxt(txtAddress.Text) Then MsgBox 请输入家庭住址!, vbOKOnly + vbExclamation, 警告 txtAddress.SetFocus Exit Sub End IfIf Not IsNumeric(Trim(txtSID.Text) Then MsgBox 请输入数字!, vbOKOnly + vbExclamation, 警告 Exit Sub txtSID.SetFocus End If txtSQL = select * from student_info where student_ID= & Trim(txtSID.Text) & Set mrc = ExecuteSQL(txtSQL, MsgText) If mrc.EOF = False Then MsgBox 学号重复,请重新输入!, vbOKOnly + vbExclamation, 警告 mrc.Close txtSID.SetFocus Else mrc.Close If Not IsDate(txtBorndate.Text) Then MsgBox 出生日期应输入日期格式(yyyy-mm-dd)!, vbOKOnly + vbExclamation, 警告 txtBorndate.SetFocus Else txtBorndate = Format(txtBorndate, yyyy-mm-dd) If Not IsDate(txtRudate.Text) Then MsgBox 入校日期应输入日期格式(yyyy-mm-dd)!, vbOKOnly + vbExclamation, 警告 txtRudate.SetFocus Else txtRudate = Format(txtRudate, yyyy-mm-dd) txtSQL = select * form studet_Info Set mrc = ExecuteSQL(txtSQL, MsgText) mrc.AddNew mrc.Fields(0) = Trim(txtSID.Text) mrc.Fields(1) = Trim(txtName.Text) mrc.Fields(2) = Trim(txtCombosex.Text) mrc.Fields(3) = Trim(txtBorndate.Text) mrc.Fields(4) = Trim(comboClassno.Text) mrc.Fields(5) = Trim(txtTel.Text) mrc.Fields(6) = Trim(txtRudate.Text) mrc.Fields(7) = Trim(txtAddress.Text) mrc.Fields(8) = Trim(txtComment.Text) mrc.Update MsgBox 添加学籍信息成功!, vbOKOnly + vbExclamation, 警告 mrc.Close Me.Hide End If End If End IfEnd SubB、修改学籍信息 选择“学籍管理”-“修改学籍信息”命令弹出如的窗体,这个窗体在“添加学籍信息”窗体的基础添加两排按钮,如图所示:C、查询学籍信息窗体的创建 选择“学籍管理“-”查询学籍信息“命令,在这里可以用按照组合的方式进行查询:如下图的效果: 实现如上图的效果,查询学籍的代码如下:Dim mrc As ADODB.RecordsetDim myBookmark As VariantDim mcclean As BooleanPrivate Sub Form_Load() Dim txtSQL As String Dim MsgText As String ComboGrader.Enabled = False comboClassno.Enabled = False comboSID.Enabled = False txtBorndate.Enabled = False txtName.Enabled = False txtTel.Enabled = False txtRudate.Enabled = False txtComment.Enabled = False txtSQL = select * from result_Info Set mrc = ExecuteSQL(txtSQL, MsgText) If mrc.EOF = False Then mrc.MoveFirst Call viewDate myBookmark = mrc.Bookmark Else MsgBox 没有记录!, vbOKOnly + vbExclamation, 警告 Exit Sub End IfEnd SubPrivate Sub viewDate() ComboGrader.Text = mrc!student_Grade comboClassno.Text = mrc!Class_No comboSID.Text = mrc!student_ID comboCourse.Text = mrc!Course_Name txtName.Text = mrc!student_Name txtResult.Text = mrc!resultEnd SubPrivate Sub FristCommend_Click() mrc.MoveFirst Call viewDateEnd SubPrivate Sub LastCommend_Click() mrc.MoveLast Call viewDateEnd SubPrivate Sub PreviousCommend_Click() mrc.MovePrevious If mrc.BOF Then mrc.MoveLast End If Call viewDateEnd SubPrivate Sub NextCommend_Click() mrc.MoveNext If mrc.EOF Then mrc.MoveFirst End If Call viewDateEnd SubPrivate Sub EditCommend_Click() Dim mrcc As ADODB.Recordset Dim txtSQL As String Dim MsgText As String fristCommend.Enabled = False LastCommend.Enabled = False PreviousCommend.Enabled = False NextCommend.Enabled = False txtSID.Enabled = True txtName.Enabled = True comboSex.Enabled = True txtBorndate.Enabled = True comboClassno.Enabled = True txtTel.Enabled = True txtAddress.Enabled = True txtComment.Enabled = True myBookmark = mrc.BookmarkEnd SubPrivate Sub UpdateCommend_Click() Dim txtSQL As String Dim MsgText As String Dim mrcc As ADODB.Recordset If mcclean Then MsgBox 请先修改学籍信息!, vbOKOnly + vbExclamation, 警告 Exit Sub End If If Not Testtxt(txtSID.Text) Then MsgBox 请输入学号!, vbOKOnly + vbExclamation, 警告 txtSID.SetFocus Exit Sub End If If Not Testtxt(txtName.Text) Then MsgBox 请输入姓名!, vbOKOnly + vbExclamation, 警告 txtName.SetFocus Exit Sub End If If Not Testtxt(comboSex.Text) Then MsgBox 请输入姓别!, vbOKOnly + vbExclamation, 警告 comboSex.SetFocus Exit Sub End If If Not Testtxt(txtBorndate.Text) Then MsgBox 请输入出生日期!, vbOKOnly + vbExclamation, 警告 txtBorndate.SetFocus Exit Sub End If If Not Testtxt(comboClassno.Text) Then MsgBox 请输入班号!, vbOKOnly + vbExclamation, 警告 comboClassno.SetFocus Exit Sub End If If Not Testtxt(txtTel.Text) Then MsgBox 请输入联系电话!, vbOKOnly + vbExclamation, 警告 txtTel.SetFocus Exit Sub End If If Not Testtxt(txtRudate.Text) Then MsgBox 请输入入校日期!, vbOKOnly + vbExclamation, 警告 txtRudate.SetFocus Exit Sub End If If Not Testtxt(txtAddress.Text) Then MsgBox 请输入家庭住址!, vbOKOnly + vbExclamation, 警告 txtAddress.SetFocus Exit Sub End If If Not IsNumeric(Trim(txtSID.Text) Then MsgBox 学号请输入数字!, vbOKOnly

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论