首页 数据库课程设计——教学管理系统论文网页版

数据库课程设计——教学管理系统论文网页版

举报
开通vip

数据库课程设计——教学管理系统论文网页版毕业论文 数据库技术 中南大学教学管理系统论文 学院:信息科学与工程学院 专业:电气工程及其自动化 班级:××× 姓名:木雕小象 学号:××× 日期:2010年12月30日 摘 要 中南大学教学管理系统的工作主要是对学生,教师,课程,基本情况和用户进行管理的现代化的信息管理系统。每个管理模块都包括数据查询、修改、删除、添加等功能,中南大学教学管理系统能高效、准确地完成这些功能,并达到界面美观友好、使用方便。其开发主要包括前端应用程序的开发以及后台数据库的建立和维护两个方面。对于前者要求应用程序功能完备,易使用等特点...

数据库课程设计——教学管理系统论文网页版
毕业论文 数据库技术 中南大学教学管理系统论文 学院:信息科学与工程学院 专业:电气工程及其自动化 班级:××× 姓名:木雕小象 学号:××× 日期:2010年12月30日 摘 要 中南大学教学管理系统的工作主要是对学生,教师,课程,基本情况和用户进行管理的现代化的信息管理系统。每个管理模块都包括数据查询、修改、删除、添加等功能,中南大学教学管理系统能高效、准确地完成这些功能,并达到界面美观友好、使用方便。其开发主要包括前端应用程序的开发以及后台数据库的建立和维护两个方面。对于前者要求应用程序功能完备,易使用等特点。而对于后者则要求建立起数据一致性和完整性强、数据安全性好的库。实现的方法主要用Borland Delphi 7和Microsoft公司的 SQL Server 2000 开发工具来完成界面与数据库的开发工作。 关键词:管理, 一致性, 完整性, 安全性 目录 TOC \o "1-3" \h \z HYPERLINK \l "_Toc132865175" 1.引言 5 HYPERLINK \l "_Toc132865176" 1.1项目开发背景 5 HYPERLINK \l "_Toc132865177" 1.2.项目开发的目标 5 HYPERLINK \l "_Toc132865183" 2.系统分析 6 HYPERLINK \l "_Toc132865184" 2.1.可行性研究 6 HYPERLINK \l "_Toc132865185" 2.1.1经济可行性研究 6 HYPERLINK \l "_Toc132865186" 2.1.2.技术可行性研究 6 HYPERLINK \l "_Toc132865191" 2.3. 系统功能分解图 8 HYPERLINK \l "_Toc132865195" 3.系统设计 9 HYPERLINK \l "_Toc132865196" 3.1.概要设计 9 HYPERLINK \l "_Toc132865200" 3.1.2.系统的总体布局 方案 气瓶 现场处置方案 .pdf气瓶 现场处置方案 .doc见习基地管理方案.doc关于群访事件的化解方案建筑工地扬尘治理专项方案下载 10 HYPERLINK \l "_Toc132865202" 3.2.系统详细设计 11 HYPERLINK \l "_Toc132865203" 3.2.1.功能模块设计 11 HYPERLINK \l "_Toc132865204" 3.2.2.数据库设计 11 HYPERLINK \l "_Toc132865205" 3.2.3.对话设计 14 HYPERLINK \l "_Toc132865205" 3.2.4.学生信息算法说明 15 HYPERLINK \l "_Toc132865210" 3.3.管理系统的实现 16 HYPERLINK \l "_Toc132865211" 3.3.1.系统开发平台 16 HYPERLINK \l "_Toc132865212" 3.3.2.菜单的实现 17 HYPERLINK \l "_Toc132865223" 41.系统在的问题 21 HYPERLINK \l "_Toc132865225" 4.2.心得体会 21 HYPERLINK \l "_Toc132865226" 参考文献 21 1.引言 1.1项目开发背景 本系统作为大三第一学期《数据库技术》课程的作业。要求采用Borland Delphi 7 和Microsoft SQL Server 2000 做为开发工具开发一个中南大学教学管理系统。 1.2.项目开发的目标 建立一个教务信息管理系统,主要功能为实现对学生,教师,班级,系部,选修,课程,授课和用户等基本信息的添加,修改,删除和查询。因为时间不足,而且第一次接触Borland Delphi 7和Mircosoft SQL Server 2000这两个开发工具,所以并没有设立权限,也没有建立索引和视图等来优化系统功能。只是实现了对信息的基本处理功能。 1.4.数据库系统的选择原则 (1)数据库系统采用易于集成的,开放的技术。 (2)产品质量优异,可靠性高,适于长期运行,能支持关键应用。 (3)数据安全,保安型高。 (4)能提供分布式数据库功能。 (5)支持多种开发环境,软件开发容易。 (6)扩充性和升级能力强。 2.系统分析 2.1.可行性研究 2.1.1经济可行性研究 经济可行性---估计开发费用以及最终从开发成功的系统所获得的收入或利益,衡量比较支出的费用和收到的利益。对于一个基于计算机系统的研制项目要在经济方面评价其是否合理,成本--效益分析要估计出研制开发的花费并与收益(包括有形的可以用货币计数的及无形的利益)衡量比较。 而该系统的设计只是通过网络自己下载免费开发工具来开发,所以经济方面可行。 2.1.2.技术可行性研究 技术可行性---分析功能,性能以及限制条件,能否是一个技术上可实现的系统。开发该软件的基本要求与功能是实现教务信息数据的管理与操作处理,基于数据库系统的数据管理使该软件有更优异的性能。系统的基本数据流动为教务数据的输入,学生信息,课程信息,教师信息,授课信息,班级信息,选修信息,系部信息和用户信息的添加与修改,以及有关用户提出的对教务信息查询要求所产生的数据输出。数据的输入与输出处理 流程 快递问题件怎么处理流程河南自建厂房流程下载关于规范招聘需求审批流程制作流程表下载邮件下载流程设计 都依靠数据库的支持。MicrosoftSQLServer 2000数据的完整性保证性能比较令人满意,该软件设计中保持与其他一些数据库的基本兼容。就目前使用的开发技术来说系统的功能目标应该能够达到;利用现有的技术在 规定 关于下班后关闭电源的规定党章中关于入党时间的规定公务员考核规定下载规定办法文件下载宁波关于闷顶的规定 的期限内开发工作基本能够完成。 2.2.业务流程图 经过系统的调查与系统分析得到学生基本信息的基本业务流程图如下: SHAPE \* MERGEFORMAT 图2.1学生 关于同志近三年现实表现材料材料类招标技术评分表图表与交易pdf视力表打印pdf用图表说话 pdf 操作业务流程图 图2.2给出了教务信息管理业务流程图,图中表明在学生管理模块中要建立一个学生数据库,学生管理工作中的输入、编辑和查询都与此数据库发生业务。 2.3.系统功能分解图 图2.1粗略给出了整个系统的框架,中南大学教学管理系统分为学生、教师、课程 表操作子功能:对学生的一些基本的信息进行管理工作如:学生的学号、姓名、等进行管理。 2.4.系统需求分析 2.4.1功能需求 1、能够查询学生,教师,班级,专业,课程等所有信息 2、能够通过知道学生,教师,教师课程的一个信息找到其它的相关信息(例如:知道学生的姓名能够找到该学生的所有有关的信息) 3、通过一条信息找到与之匹配的信息(例如:查询同一专业或同班级的所有学生) 4、管理人员能对学生,教师,和课程信息进行管理(例如:因为学生有关情况不是固定不变的所以一旦学生信息发生改变就要对原有信息进行诸如添加,删除,修改等的操作) 2.4.2.性能需求 1、数据精确度 查询时应保证查全率,所有相应域包含查询关键字的 记录 混凝土 养护记录下载土方回填监理旁站记录免费下载集备记录下载集备记录下载集备记录下载 都应能查到 2、时间特性 一般操作的响应时间应在1-2秒内 3、适应性 对运行环境要求普遍适应性 2.4.3.运行需求 1、用户界面 利用菜单界面驱动方式,对用户友好。必须对鼠标和键盘单独支持 2、硬件接口 支持一般奔腾Ⅲ,128兆以上内存的pc机。 3、软件接口 运行于Windows9X及更高版本具有WIN32API的操作系统上 3.系统设计 3.1.概要设计 针对以上系统要完成的功能,本系统总体设计采用自顶向下,逐步细化的方法将功能层次结构的各个部分组合起来,以完成整个系统的实现细节。 3.1.1模块结构 图3.1 系统功能结构图 有关功能说明: 学生表操作功能:以分类形式录入在校学生的基本基本信息存放在学生基本数据库文件中。并同时具有对学生基本数据库文件进行查询,添加,修改和删除记录功能。 本模块又分为三个子模块: (1)学生信息添加 (2)学生信息查询 (3)学生信息编辑(修改/删除) 2.教师表操作,课程表模块和学生表操作模块功能相似。 3.1.2.系统的总体布局方案 中南大学教学管理系统分为学生表操作、教师表操作,课程表,安全退出七个子系统。用户在进入此系统时首先必须在进行身份的确认,只有是合法用户才能进入此系统,否则将无法使用此系统。如果是合法用户,就可以进行对学生表操作、教师表操作,课程表进行管理工作(如添另、更新、删除、查询等操作)。 3.2.系统详细设计 3.2.1.功能模块设计 一、用户管理模块 在用户管理模块中又把此模块分为三个小的模块分别为: 1.添加 在输入模块中通过在表单中的一个确定按钮使得用户在界面中通过键盘或通过标输入的数据插入到数据库中的学生基本信息表中,通过退出按钮结束学生信息的添加。 2.修改和删除 当用户进入修改和删除窗口时,编辑窗口中的数据绑定型控件都与学生基本信息表中的字段进行绑定。 3.查询 当用户进入查询窗口时,在查询窗口的文本框中输入要查询的关键字如性名或学号时,并点确定按钮,按钮中的SQL查询语句就会执行,使得结果显示在此表单的下方的表格中。 二、学生表操作、教师表操作,课程表,系统安全这四个模块的每一个模块都包含以上的三个小模块,在此不再重复。 3.2.2.数据库设计 一、数据库概念结构设计 这一设计阶段是在需求分析的基础上,设计出能够满足用户需求的各种实体,以及它们之间的关系,为后面的逻辑结构设计打下基础,可以用实体-关系模型来描述. 实体-关系模型(Entity-relationship Mode,简称E-R模型)是数据库设计常用的方法.E-R图中的矩形表示实体,菱形表示实体之间的联系,联系的类型可以用1:1或1:M或M:N表示,圆角矩形表示实体的有关属性,椭圆表示实体的具体属性。下图是学生表操作系统各个实体的E-R图。 3-1学生实体E-R图 3-2教师实体E-R图 3-3课程实体E-R图 二、数据库逻辑设计 下面需要将数据库概念结构转化为SQL Sever数据库系统所支持的实际数据模型,也就是数据库的逻辑结构。在上面的实体以及实体之间关系的基础上,形成数据库中的表格以及各个表格之间的关系。 设计一个项目,项目名为教务管理信息系统并在此项目中创建一个数据库,数据库名为EducationManagerSystem此数据库中包含学生、课程、教师、用户表。 表结构如下: 学生表操作(student) 课程表(course) 教师表(teacher) 用户表(login) 3.2.3.对话设计 在对话设计的过程中遵循了对话设计的原则: 1.对话要清楚、没有二义性。 2.对用户的响应要快,而且要进行了回答的有效性检验。 3.对话比较适合用户的要求与习惯,应该问的问题问了,问得不频繁。 4.注意询问格式的美观、实用,而且采用了统一的格式,体现了一定的风格。 首先系统判断用户在主菜单上所输入的功能选择码是否合法,并根据选择码进入相应功能模块。 3.2.4.学生基本信息算法说明 1.​ 录入过程 1)​ 用户添加数据。 2)​ 系统检查用户输入的学生基本信息的合法性,如学生的学号的宽度与学生的出生日期的合法性等。 3)​ 检查错误时,弹出一个错误的对话框并提示用户如何操作。 4)​ 当检查正确后将在录入表单的数据插入到学生基本信息数据库表文件中。 5)​ 结束。 2.​ 查询过程 1)​ 用户输入要查询的学生的学号或姓名等其它信息。 2)​ 系统根据用户输入的学生的学号先从学生基本信息数据库表文件中读出该记录。 3)​ 若找不到,则不显示。 4)​ 结束。 3.​ 修改过程 1)​ 用户输入要修改的学生的学号名字。 2)​ 系统根据用户输入的学号或名字先从学生基本信息数据库表文件中读出该记录。 3)​ 如找不到,则不显示。 4)​ 用户输入修改数据。 5)​ 检查输入数据合法性。 6)​ 结束。 4.​ 删除记录 1)​ 用户输入要删除的学生的学号或姓名。 2)​ 系统根据用户输入的学生的学号先从学生基本信息数据库表文件中读出该记录。 3)​ 用户确定删除数据。 4)​ 从主文件中删除该记录。 5)​ 结束。 学生表操作、教师表操作,课程表,系统安全这四个模块的算法说明基本相同。 3.3.管理系统的实现 3.3.1.系统开发平台 管理系统是在如下配置中进行的: 硬件:AMD5400+,2G兆内存320G的硬盘的pc机 软件:Windows XP 操作系统,Borland Delphi 7,Microsoft SQL Server 2000 3.3.2.菜单的实现 用户在进行用户确认后进入如图4-1菜单: 图4-1用户进入界面 3.3.3.用户管理员认证表单的实现 系统管理员在作为普通用户进入系统后,必须再经过如图4-2中表单的确认后方可进行用户管理。 图4-2 登陆界面 在其界面中系统管理名与系统管理员口令都运用了文本框让使用者输入其目的就增加其保密性。 3.3.4.学生基本信息表单添加的实现 图4-3学生信息录入 3.3.5.学生信息修改表单的实现 图4-4课程信息编辑 图4.5是学生信息修改和删除界面,此界面由于是修改和删除界面所以所有的数据绑定控件均为文本框,每一个文本框都与课程表的一个字段进行绑定。 3.3.6.学生信息查询的实现 图4-5学生成绩查询 图4.6是学生个人信息查询界面,此界面中通过在组合框中选择要查询的学号、姓名、课程代号、专业和班级代号等多种查询手段,并在其后的文本框中输入要查询的值,然后单击确定按钮在下方的表格中就会显示出查询的结果。 4.总结 4.1.系统在的问题 教务管理信息系统开发完成后,由于开发设计的时间较短,对开发工具Microsoftt SQL Server 2000和Borland Delphi 7 不熟悉,所以说本系统的存在的问题 一是作为一个完全教务处能够运行的系统可能功能不够完善; 二,没有设置权限。 三.没有建立索引等来优化系统功能。 4.2.心得体会 通过自己查询相关书藉和对网络资源的利用,可以让我们对Borland Delphi 7 和Microsoft SQL Server 2000这两个开发工具有了具体的了解,从而上升到运用的层次;同时了解了开发一个系统所要做的具体工作。 参考文献 [1]萨师煊 王珊 “数据库系统概论”,高等教育出版社,1999 附件: unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, DB, ADODB, StdCtrls, jpeg, ExtCtrls; type TForm1 = class(TForm) Image1: TImage; Label1: TLabel; Edit1: TEdit; Label2: TLabel; Edit2: TEdit; Button1: TButton; Button2: TButton; ADOQuery1: TADOQuery; DataSource1: TDataSource; ADOConnection1: TADOConnection; procedure Button1Click(Sender: TObject); procedure Button2Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.dfm} uses unit2; procedure TForm1.Button1Click(Sender: TObject); var username,password:string; begin username :=trim(edit1.Text); password :=trim(edit2.Text); if username='' then begin ShowMessage('用户名不能为空'); end else if password='' then begin ShowMessage('密码不能为空'); end else begin adoquery1.Close; adoquery1.SQL.Clear; adoquery1.SQL.Add('select * from login where username='''+username+''' and password ='''+password+''''); adoquery1.Open; if adoquery1.RecordCount <1 then begin showmessage('用户名或密码错误'); end else begin Form1.Hide; Form2.Show; end; end; end; procedure TForm1.Button2Click(Sender: TObject); begin Application.Terminate; end; end. unit Unit2; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, Menus, StdCtrls, jpeg, ExtCtrls; type TForm2 = class(TForm) MainMenu1: TMainMenu; N1: TMenuItem; N2: TMenuItem; N3: TMenuItem; N4: TMenuItem; N5: TMenuItem; N6: TMenuItem; Image1: TImage; Label1: TLabel; Label2: TLabel; procedure N2Click(Sender: TObject); procedure N3Click(Sender: TObject); procedure N5Click(Sender: TObject); procedure N6Click(Sender: TObject); procedure N4Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form2: TForm2; implementation uses Unit3, Unit4, Unit5, Unit6; {$R *.dfm} procedure TForm2.N2Click(Sender: TObject); begin form2.Hide; form3.show; end; procedure TForm2.N3Click(Sender: TObject); begin form2.hide; form4.show; end; procedure TForm2.N5Click(Sender: TObject); begin form2.close; end; procedure TForm2.N6Click(Sender: TObject); begin form2.hide; form5.show; end; procedure TForm2.N4Click(Sender: TObject); begin form2.hide; form6.show; end; end. unit Unit3; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, Grids, DBGrids, StdCtrls, DB, ADODB; type TForm3 = class(TForm) Label1: TLabel; Label2: TLabel; Edit1: TEdit; Label3: TLabel; Edit2: TEdit; Label4: TLabel; Edit3: TEdit; Label5: TLabel; Edit4: TEdit; Label6: TLabel; Edit5: TEdit; Label7: TLabel; Edit6: TEdit; Button1: TButton; Label8: TLabel; ComboBox1: TComboBox; Label9: TLabel; Edit7: TEdit; Button2: TButton; DBGrid1: TDBGrid; ComboBox2: TComboBox; Label10: TLabel; Label11: TLabel; Edit8: TEdit; Label12: TLabel; Edit9: TEdit; Button3: TButton; Label13: TLabel; Label14: TLabel; ComboBox3: TComboBox; Edit10: TEdit; Button5: TButton; ADOQuery1: TADOQuery; DataSource1: TDataSource; Button4: TButton; ADOConnection1: TADOConnection; procedure Button5Click(Sender: TObject); procedure Button2Click(Sender: TObject); procedure Button3Click(Sender: TObject); procedure Button1Click(Sender: TObject); procedure Button4Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form3: TForm3; implementation uses Unit2; {$R *.dfm} procedure TForm3.Button5Click(Sender: TObject); begin form3.hide; form2.show; end; procedure TForm3.Button2Click(Sender: TObject); begin if combobox1.ItemIndex=0 then begin adoquery1.Close; Adoquery1.sql.Clear; adoquery1.sql.Add('select * from 学生表 where 学号='''+edit7.Text+''''); adoquery1.open; if adoquery1.RecordCount=0 then showmessage('对不起,没有此学号,请重新输入'); dbgrid1.Visible:=true; end else if combobox1.ItemIndex=1 then begin adoquery1.Close; Adoquery1.sql.Clear; adoquery1.sql.Add('select *from 学生表 where 姓名='''+edit7.Text+''''); adoquery1.open; if adoquery1.RecordCount=0 then showmessage('对不起,没有此姓名,请重新输入'); dbgrid1.Visible:=true; end else if combobox1.ItemIndex=2 then begin adoquery1.Close; Adoquery1.sql.Clear; adoquery1.sql.Add('select *from 学生表 where 籍贯='''+edit7.Text+''''); adoquery1.open; if adoquery1.RecordCount=0 then showmessage('对不起,没有此籍贯,请重新输入'); dbgrid1.Visible:=true; end else if combobox1.ItemIndex=3 then begin adoquery1.Close; Adoquery1.sql.Clear; adoquery1.sql.Add('select *from 学生表 where 专业='''+edit7.Text+''''); adoquery1.open; if adoquery1.RecordCount=0 then showmessage('对不起,没有此专业,请重新输入'); dbgrid1.Visible:=true; end else if combobox1.ItemIndex=4 then begin adoquery1.Close; Adoquery1.sql.Clear; adoquery1.sql.Add('select *from 学生表 where 年龄='''+edit7.Text+''''); adoquery1.open; if adoquery1.RecordCount=0 then showmessage('对不起,没有此年龄,请重新输入'); dbgrid1.Visible:=true; end else if combobox1.ItemIndex=5 then begin adoquery1.Close; Adoquery1.sql.Clear; adoquery1.sql.Add('select *from 学生表 where 性别='''+edit7.Text+''''); adoquery1.open; if adoquery1.RecordCount=0 then showmessage('对不起,没有此性别,请重新输入'); dbgrid1.Visible:=true; end end; procedure TForm3.Button3Click(Sender: TObject); begin if combobox2.ItemIndex=1 then begin adoquery1.Close; Adoquery1.sql.Clear; adoquery1.sql.Add('update 学生表 set 姓名='''+edit9.Text+''' where 姓名='''+edit8.Text+''''); adoquery1.ExecSQL; showmessage('修改学生信息记录成功!'); adoquery1.Close; Adoquery1.sql.Clear; adoquery1.sql.Add('select *from 学生表 where 姓名='''+edit9.Text+''''); adoquery1.Open; dbgrid1.Visible:=true; end else if combobox2.ItemIndex=2 then begin adoquery1.Close; Adoquery1.sql.Clear; adoquery1.sql.Add('update 学生表 set 籍贯='''+edit9.Text+''' where 籍贯='''+edit8.Text+''' and 学号='''+edit7.Text+''''); adoquery1.ExecSQL; showmessage('修改学生信息记录成功!'); adoquery1.Close; Adoquery1.sql.Clear; adoquery1.sql.Add('select *from 学生表 where 籍贯='''+edit9.Text+'''' ); adoquery1.Open; dbgrid1.Visible:=true; end else if combobox2.ItemIndex=3 then begin adoquery1.Close; Adoquery1.sql.Clear; adoquery1.sql.Add('update 学生表 set 专业='''+edit9.Text+''' where 专业='''+edit8.Text+''' and 学号='''+edit7.Text+''''); adoquery1.ExecSQL; showmessage('修改学生信息记录成功!'); adoquery1.Close; Adoquery1.sql.Clear; adoquery1.sql.Add('select *from 学生表 where 专业='''+edit9.Text+''' and 学号='''+edit7.Text+''''); adoquery1.Open; dbgrid1.Visible:=true; end else if combobox2.ItemIndex=4 then begin adoquery1.Close; Adoquery1.sql.Clear; adoquery1.sql.Add('update 学生表 set 年龄='''+edit9.Text+''' where 年龄='''+edit8.Text+''' and 学号='''+edit7.Text+''''); adoquery1.ExecSQL; showmessage('修改学生信息记录成功!'); adoquery1.Close; Adoquery1.sql.Clear; adoquery1.sql.Add('select *from 学生表 where 年龄='''+edit9.Text+''' and 学号='''+edit7.Text+''''); adoquery1.Open; dbgrid1.Visible:=true; end else if combobox2.ItemIndex=5 then begin adoquery1.Close; Adoquery1.sql.Clear; adoquery1.sql.Add('update 学生表 set 性别='''+edit9.Text+''' where 性别='''+edit8.Text+''' and 学号='''+edit7.Text+''''); adoquery1.ExecSQL; showmessage('修改学生信息记录成功!'); adoquery1.Close; Adoquery1.sql.Clear; adoquery1.sql.Add('select *from 学生表 where 性别='''+edit9.Text+''' and 学号='''+edit7.Text+''''); adoquery1.Open; dbgrid1.Visible:=true; end end; procedure TForm3.Button1Click(Sender: TObject); begin adoquery1.Close; Adoquery1.sql.Clear; adoquery1.sql.Add('insert into 学生表 (学号 ,姓名,籍贯 ,专业,年龄,性别) values('''+edit1.Text+''' ,'''+edit2.Text+''' ,'''+edit3.Text+''','''+edit4.Text+''','''+edit5.Text+''','''+edit6.Text+''')'); adoquery1.ExecSQL; showmessage('添加学生信息记录成功!'); adoquery1.Close; Adoquery1.sql.Clear; adoquery1.sql.Add('select *from 学生表'); adoquery1.Open; dbgrid1.Visible:=true; end; procedure TForm3.Button4Click(Sender: TObject); begin if combobox3.ItemIndex=0 then begin adoquery1.Close; Adoquery1.sql.Clear; adoquery1.sql.Add('delete from 学生表 where 学号='''+edit10.Text+''' '); adoquery1.ExecSQL; showmessage('删除学生记录成功!'); adoquery1.Close; Adoquery1.sql.Clear; adoquery1.sql.Add('select *from 学生表 '); adoquery1.open; dbgrid1.Visible:=true; end else if combobox3.ItemIndex=1 then begin adoquery1.Close; Adoquery1.sql.Clear; adoquery1.sql.Add('delete from 学生表 where 姓名='''+edit10.Text+''' '); adoquery1.ExecSQL; showmessage('删除学生记录成功!'); adoquery1.Close; Adoquery1.sql.Clear; adoquery1.sql.Add('select *from 学生表 '); adoquery1.open; dbgrid1.Visible:=true; end else if combobox3.ItemIndex=2 then begin adoquery1.Close; Adoquery1.sql.Clear; adoquery1.sql.Add('delete from 学生表 where 籍贯='''+edit10.Text+''' '); adoquery1.ExecSQL; showmessage('删除学生记录成功!'); adoquery1.Close; Adoquery1.sql.Clear; adoquery1.sql.Add('select *from 学生表 '); adoquery1.open; dbgrid1.Visible:=true; end else if combobox3.ItemIndex=3 then begin adoquery1.Close; Adoquery1.sql.Clear; adoquery1.sql.Add('delete from 学生表 where 专业='''+edit10.Text+''' '); adoquery1.ExecSQL; showmessage('删除学生记录成功!'); adoquery1.Close; Adoquery1.sql.Clear; adoquery1.sql.Add('select *from 学生表 '); adoquery1.open; dbgrid1.Visible:=true; end else if combobox3.ItemIndex=4 then begin adoquery1.Close; Adoquery1.sql.Clear; adoquery1.sql.Add('delete from 学生表 where 年龄='''+edit10.Text+''' '); adoquery1.ExecSQL; showmessage('删除学生记录成功!'); adoquery1.Close; Adoquery1.sql.Clear; adoquery1.sql.Add('select *from 学生表 '); adoquery1.open; dbgrid1.Visible:=true; end else if combobox3.ItemIndex=5 then begin adoquery1.Close; Adoquery1.sql.Clear; adoquery1.sql.Add('delete from 学生表 where 性别='''+edit10.Text+''' '); adoquery1.ExecSQL; showmessage('删除学生记录成功!'); adoquery1.Close; Adoquery1.sql.Clear; adoquery1.sql.Add('select *from 学生表 '); adoquery1.open; dbgrid1.Visible:=true; end end; end. unit Unit4; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, Grids, DBGrids, DB, ADODB; type TForm4 = class(TForm) Label1: TLabel; Label2: TLabel; Edit1: TEdit; Label3: TLabel; Edit2: TEdit; Label4: TLabel; Edit3: TEdit; Label5: TLabel; Edit4: TEdit; Label6: TLabel; Edit5: TEdit; Label7: TLabel; Edit6: TEdit; Label8: TLabel; Edit7: TEdit; Label9: TLabel; Edit8: TEdit; Button1: TButton; ADOQuery1: TADOQuery; DataSource1: TDataSource; DBGrid1: TDBGrid; Label10: TLabel; ComboBox1: TComboBox; Label11: TLabel; Edit9: TEdit; Button2: TButton; Label12: TLabel; ComboBox2: TComboBox; Label13: TLabel; Edit10: TEdit; Button3: TButton; Label14: TLabel; ComboBox3: TComboBox; Label15: TLabel; Edit11: TEdit; Label16: TLabel; Edit12: TEdit; Button4: TButton; Button5: TButton; ADOConnection1: TADOConnection; procedure Button5Click(Sender: TObject); procedure Button2Click(Sender: TObject); procedure Button4Click(Sender: TObject); procedure Button1Click(Sender: TObject); procedure Button3Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form4: TForm4; implementation uses Unit2; {$R *.dfm} procedure TForm4.Button5Click(Sender: TObject); begin form4.Hide; form2.show; end; procedure TForm4.Button2Click(Sender: TObject); begin if combobox1.ItemIndex=0 then begin adoquery1.Close; Adoquery1.sql.Clear; adoquery1.sql.Add('select * from 教师表 where 教师号='''+edit9.Text+''''); adoquery1.open; if adoquery1.RecordCount=0 then showmessage('对不起,没有此教师号,请重新输入'); dbgrid1.Visible:=true; end else if combobox1.ItemIndex=1 then begin adoquery1.Close; Adoquery1.sql.Clear; adoquery1.sql.Add('select * from 教师表 where 姓名='''+edit9.Text+''''); adoquery1.open; if adoquery1.RecordCount=0 then showmessage('对不起,没有此姓名,请重新输入'); dbgrid1.Visible:=true; end else if combobox1.ItemIndex=2 then begin adoquery1.Close; Adoquery1.sql.Clear; adoquery1.sql.Add('select * from 教师表 where 住址='''+edit9.Text+''''); adoquery1.open; if adoquery1.RecordCount=0 then showmessage('对不起,没有此住址,请重新输入'); dbgrid1.Visible:=true; end else if combobox1.ItemIndex=3 then begin adoquery1.Close; Adoquery1.sql.Clear; adoquery1.sql.Add('select * from 教师表 where 专业='''+edit9.Text+''''); adoquery1.open; if adoquery1.RecordCount=0 then showmessage('对不起,没有此专业,请重新输入'); dbgrid1.Visible:=true; end else if combobox1.ItemIndex=4 then begin adoquery1.Close; Adoquery1.sql.Clear; adoquery1.sql.Add('select * from 教师表 where 电话='''+edit9.Text+''''); adoquery1.open; if adoquery1.RecordCount=0 then showmessage('对不起,没有此电话,请重新输入'); dbgrid1.Visible:=true; end else if combobox1.ItemIndex=5 then begin adoquery1.Close; Adoquery1.sql.Clear; adoquery1.sql.Add('select * from 教师表 where 年龄='''+edit9.Text+''''); adoquery1.open; if adoquery1.RecordCount=0 then showmessage('对不起,没有此年龄,请重新输入'); dbgrid1.Visible:=true; end else if combobox1.ItemIndex=6 then begin adoquery1.Close; Adoquery1.sql.Clear; adoquery1.sql.Add('select * from 教师表 where 性别='''+edit9.Text+''''); adoquery1.open; if adoquery1.RecordCount=0 then showmessage('对不起,没有此性别,请重新输入'); dbgrid1.Visible:=true; end else if combobox1.ItemIndex=7 then begin adoquery1.Close; Adoquery1.sql.Clear; adoquery1.sql.Add('select * from 教师表 where 职称='''+edit9.Text+''''); adoquery1.open; if adoquery1.RecordCount=0 then showmessage('对不起,没有此职称,请重新输入'); dbgrid1.Visible:=true; end end; procedure TForm4.Button4Click(Sender: TObject); begin if combobox3.ItemIndex=1 then begin adoquery1.Close; Adoquery1.sql.Clear; adoquery1.sql.Add('update 教师表 set 姓名='''+edit12.Text+''' where 姓名='''+edit11.Text+''''); adoquery1.ExecSQL; showmessage('修改教师信息记录成功!'); adoquery1.Close; Adoquery1.sql.Clear; adoquery1.sql.Add('select *from 教师表 where 姓名='''+edit12.Text+''''); adoquery1.Open; dbgrid1.Visible:=true; end else if combobox3.ItemIndex=2 then begin adoquery1.Close; Adoquery1.sql.Clear; adoquery1.sql.Add('update 教师表 set 住址='''+edit12.Text+''' where 住址='''+edit11.Text+''' and 教师号='''+edit9.Text+''''); adoquery1.ExecSQL; showmessage('修改教师信息记录成功!'); adoquery1.Close; Adoquery1.sql.Clear; adoquery1.sql.Add('select *from 教师表 where 住址='''+edit12.Text+'''' ); adoquery1.Open; dbgrid1.Visible:=true; end else if combobox3.ItemIndex=3 then begin adoquery1.Close; Adoquery1.sql.Clear; adoquery1.sql.Add('update 教师表 set 专业='''+edit12.Text+''' where 专业='''+edit11.Text+''' and 教师号='''+edit9.Text+''''); adoquery1.ExecSQL; showmessage('修改教师信息记录成功!'); adoquery1.Close; Adoquery1.sql.Clear; adoquery1.sql.Add('select *from 教师表 where 专业='''+edit12.Text+''' and 教师号='''+edit9.Text+''''); adoquery1.Open; dbgrid1.Visible:=true; end else if combobox3.ItemIndex=4 then begin adoquery1.Close; Adoquery1.sql.Clear; adoquery1.sql.Add('update 教师表 set
本文档为【数据库课程设计——教学管理系统论文网页版】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑, 图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
该文档来自用户分享,如有侵权行为请发邮件ishare@vip.sina.com联系网站客服,我们会及时删除。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。
本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。
网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。
下载需要: 免费 已有0 人下载
最新资料
资料动态
专题动态
is_884581
暂无简介~
格式:doc
大小:788KB
软件:Word
页数:60
分类:互联网
上传时间:2014-01-21
浏览量:67