vb课程设计题目--设备管理系统.doc

上传人:re****.1 文档编号:544826405 上传时间:2023-03-22 格式:DOC 页数:13 大小:230.50KB
返回 下载 相关 举报
vb课程设计题目--设备管理系统.doc_第1页
第1页 / 共13页
vb课程设计题目--设备管理系统.doc_第2页
第2页 / 共13页
vb课程设计题目--设备管理系统.doc_第3页
第3页 / 共13页
vb课程设计题目--设备管理系统.doc_第4页
第4页 / 共13页
vb课程设计题目--设备管理系统.doc_第5页
第5页 / 共13页
点击查看更多>>
资源描述

《vb课程设计题目--设备管理系统.doc》由会员分享,可在线阅读,更多相关《vb课程设计题目--设备管理系统.doc(13页珍藏版)》请在金锄头文库上搜索。

1、VB程序设计课程设计课程设计题目设备管理系统 目 录一、课程设计的目的与要求二、任务描述对系统要实现的功能进行确切的描述。 三、设计 详细说明程序的设计思想,所用到的算法、数据结构技巧等四、效果及存在问题说明系统的运行效果(附上界面图形)、存在哪些不足以及预期的解决办法五、总结 课程设计的目的与要求1、教学目的使学生在理论课程结束后,通过课程设计能进一步巩固对VB编程机制的理解,真正掌握运用VB进行软件开发的方法和原理,从而锻炼学生开发能力、程序调试的能力,及程序错误处理的能力。 2、教学要求从课程设计的目的出发,通过课程设计的各个环节,达到以下教学要求(1)进一步掌握VB语言程序设计的基本思

2、想和方法;(2)掌握面向对象的可视化程序设计的基本原理及应用; 任务描述建立设备数据库表,存储设备的信息,包括设备的名称、数量、型号、规格等信息;能够实现对设备的查询、修改、添加等操作。设计1、设备管理系统的功能 1、查看设备:用来实现对设备的浏览、删除2、查询设备:用来实现对设备的查询3、添加设备:用来实现对设备的添加2、连接数据源 利用ADO控件将Access数据源连接到程序中建立Access数据库打开Access,建立名为“设备”的数据库。在数据库中选择“使用设计器创建表”输入名称、型号、单价、数量、规格、购买日期。保存命名为“设备管理”。3、窗体名称标题From1登陆界面From2查看

3、设备From3添加设备From4查找设备(1)登陆界面From1 代码如下:Private Sub Command1_Click()Form2.ShowEnd Sub(2)查看设备 Form2 代码如下:Private Sub Command1_Click()Adodc1.Recordset.MovePrevious 数据移到上一条If Adodc1.Recordset.BOF ThenAdodc1.Recordset.MoveFirstMsgBox 已经是第一条End IfEnd SubPrivate Sub Command2_Click()Adodc1.Recordset.MoveNext

4、 数据移到下一条If Adodc1.Recordset.EOF ThenAdodc1.Recordset.MoveLastMsgBox 已经是最后一条End IfEnd SubPrivate Sub Command3_Click()Form3.ShowEnd SubPrivate Sub Command4_Click()Form4.ShowEnd SubPrivate Sub Command5_Click()On Error Resume Next If MsgBox(确定删除该记录?, vbOKCancel, 提示) = vbOK Then Adodc1.Recordset.Delete 删

5、除正显示的记录 Adodc1.Recordset.MoveNext 显示下一条数据 If Adodc1.Recordset.EOF Then Adodc1.Recordset.MoveLast End If End IfEnd SubPrivate Sub Command6_Click()EndEnd SubPrivate Sub Command7_Click()Adodc1.Recordset.MoveFirst 显示第一条数据End SubPrivate Sub Command8_Click()Adodc1.Recordset.MoveLast 显示最后一条数据End Sub (3)添加设

6、备 Form3 代码如下:Private Sub Command1_Click()Adodc1.RefreshAdodc1.Recordset.AddNewAdodc1.Recordset.Fields(1) = Trim(Text1)Adodc1.Recordset.Fields(2) = Trim(Text2)Adodc1.Recordset.Fields(3) = Trim(Text3)Adodc1.Recordset.Fields(4) = Trim(Text4)Adodc1.Recordset.Fields(5) = Trim(Text5)Adodc1.Recordset.Field

7、s(6) = Trim(Text6) 将文本框中的值赋值给数据库Adodc1.Recordset.UpdateAdodc1.Recordset.MoveLastMsgBox 该设备已添加End Sub Private Sub Command2_Click()Text1.Text = Text2.Text = Text3.Text = Text4.Text = Text5.Text = Text6.Text = End SubPrivate Sub Command3_Click()Unload MeForm2.ShowEnd SubForm4 代码如下:Private Sub Command1_

8、Click()Dim check As IntegerAdodc1.RefreshAdodc1.Recordset.MoveFirstM = Trim(Text1)While Adodc1.Recordset.EOF True If Adodc1.Recordset.Fields(1) = M Then Text2.Text = Adodc1.Recordset.Fields(2) Text3.Text = Adodc1.Recordset.Fields(3) Text4.Text = Adodc1.Recordset.Fields(4) Text5.Text = Adodc1.Records

9、et.Fields(5) Text6.Text = Adodc1.Recordset.Fields(6) check = check + 1 用循环语句判断文本框中的 End If 值 是否等于数据库中相应 Adodc1.Recordset.MoveNext 的值 WendAdodc1.RefreshX = Trim(Text2)While Adodc1.Recordset.EOF True If Adodc1.Recordset.Fields(2) = X Then Text1.Text = Adodc1.Recordset.Fields(1) Text3.Text = Adodc1.Rec

10、ordset.Fields(3) Text4.Text = Adodc1.Recordset.Fields(4) Text5.Text = Adodc1.Recordset.Fields(5) Text6.Text = Adodc1.Recordset.Fields(6) check = check + 1 End If Adodc1.Recordset.MoveNextWendAdodc1.RefreshD = Val(Trim(Text3)While Adodc1.Recordset.EOF True If Adodc1.Recordset.Fields(3) = D Then Text1

11、.Text = Adodc1.Recordset.Fields(1) Text2.Text = Adodc1.Recordset.Fields(2) Text4.Text = Adodc1.Recordset.Fields(4) Text5.Text = Adodc1.Recordset.Fields(5) Text6.Text = Adodc1.Recordset.Fields(6) check = check + 1 End If Adodc1.Recordset.MoveNextWendAdodc1.RefreshS = Val(Trim(Text4)Adodc1.Recordset.M

12、oveFirstWhile Adodc1.Recordset.EOF True If Adodc1.Recordset.Fields(4) = S Then Text1.Text = Adodc1.Recordset.Fields(1) Text2.Text = Adodc1.Recordset.Fields(2) Text3.Text = Adodc1.Recordset.Fields(3) Text5.Text = Adodc1.Recordset.Fields(5) Text6.Text = Adodc1.Recordset.Fields(6) check = check + 1 End

13、 If Adodc1.Recordset.MoveNextWendAdodc1.RefreshG = Trim(Text5)While Adodc1.Recordset.EOF True If Adodc1.Recordset.Fields(5) = G Then Text1.Text = Adodc1.Recordset.Fields(1) Text2.Text = Adodc1.Recordset.Fields(2) Text3.Text = Adodc1.Recordset.Fields(3) Text4.Text = Adodc1.Recordset.Fields(4) Text6.Text = Adodc1.Recordset.Fields(6) check = check + 1 End If Adodc1.Recordset.MoveNextWendAdodc1.RefreshR = Trim(Text6)While Adodc1.Recordset.EOF True If Adodc1.Recordset.Fields(6) = R Then

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 中学教育 > 其它中学文档

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号