学生综合管理系统毕业设计(编辑修改稿)内容摘要:

y + vbInformation, 提示 End If End Sub Private Sub Command4_Click() Unload Me End Sub Private Sub Form_Load() 39。 打开数据库中的 score 和 leixing表 OpenTable Adodc1, score OpenTable Adodc2, leixing 22 39。 初始化 bo 的初值 For i = 0 To 2 Combo1(i).Text = Combo1(i).List(ListIndex) Next i 39。 连接 DataGrid1 表到数据库 Set = Adodc1 39。 初始化 bo1(3)的值 Combo1(3).Clear Do Until Combo1(3).AddItem !类型 Loop Combo1(3).ListIndex = 0 End Sub 4. 4. 2 成绩添加 23 图 成 绩添加 设计过程: 有权限的用户可以进行成绩的添加或删除的操作,学期,专业,类型都可以从 bo框中选择,学号,姓名是用户自己输入的,且不能为空,还有考试成绩,使用了 keypress事件,只能键入数字,而且限定长度为 3 位数。 设计代码: Private Sub bo1_KeyPress(KeyAscii As Integer) 39。 回车换下一个输入项目 If KeyAscii = 13 Then SendKeys {TAB} End If End Sub Private Sub bo2_KeyPress(KeyAscii As Integer) 39。 回车换下一个输入项目 If KeyAscii = 13 Then SendKeys {TAB} End If End Sub Private Sub Combo3_KeyPress(KeyAscii As Integer) 39。 回车换下一个输入项目 If KeyAscii = 13 Then SendKeys {TAB} End If End Sub Private Sub Command1_Click() 39。 判断文本框是否为空 If = Then MsgBox amp。 不能为空。 , vbExclamation + vbOKOnly, 警告 Exit Sub End If If = Then MsgBox Label2(2).Caption amp。 不能为空。 , vbExclamation + vbOKOnly, 警告 Exit Sub 24 End If If = Then MsgBox Label2(4).Caption amp。 不能为空。 , vbExclamation + vbOKOnly, 警告 Exit Sub End If If flAg = True Then 39。 确定后执行的语句 If MsgBox(确定要添加么。 , vbYesNo + vbInformation, 提示 ) = vbYes Then MsgBox 添加成功。 , vbOKOnly + vbInformation, 提示 39。 数据传递到数据库 !学期 = !班级 = !学号 = !姓名 = !课程名称 = Visual Basic !类型 = !分数 = !年级 = 2020 级 End If Else 39。 确定后执行的语句 If MsgBox(确定要修 改么。 , vbYesNo + vbInformation, 提示 ) = vbYes Then MsgBox 修改成功。 , vbOKOnly + vbInformation, 提示 39。 数据传递到数据库 !学期 = !班级 = !学号 = !姓名 = !课程名称 = Visual Basic !类型 = !分数 = !年级 = 2020 级 End If 25 End If Unload Me End Sub Private Sub Form_Load() = (ListIndex) = (ListIndex) 39。 初始化 bo3 的值 Do Until !类型 Loop = 0 39。 判断是否是修改的窗体 If flAg = False Then = 成绩修改 = 修改 39。 数据库数据传递到文本里 = !学期 = !班级 = !学号 = !姓名 = !类型 = !分数 End If End Sub Private Sub Form_Activate() End Sub Private Sub Command2_Click() 39。 退出该窗体 Unload Me End Sub Private Sub text1_KeyPress(KeyAscii As Integer) 39。 回车换下一个输入项目 If KeyAscii = 13 Then 26 SendKeys {TAB} End If End Sub Private Sub text2_KeyPress(KeyAscii As Integer) 39。 回车换下一个输入项目 If KeyAscii = 13 Then SendKeys {TAB} End If If KeyAscii = 8 Then Text2 = End If End Sub Private Sub text3_KeyPress(KeyAscii As Integer) 39。 回车换下一个输入项目 If KeyAscii = 13 Then SendKeys {TAB} End If End Sub 4. 4. 3 考试类型设置 27 图 考试类型设置 设计过程: 有权限的用户盒超级管理员可以进行考试类型的增加,修改,删除等操作。 在此窗体修改过的东西会在其它具有选择类型的 bo 控件的窗体中作出相应的修改。 最大特点是在点击增加或修改按钮时,其他按钮的 enable 属性会变成 false,以免造成不正确的操作。 设计代码: Private Sub Command1_Click() 39。 增加考试类型的代码 If = 加入列表 Then = select * from leixing where 类型 =39。 amp。 amp。 39。 39。 判 断是否重复 If = False Then MsgBox 已经存在该类型名称。 , vbOKOnly + vbExclamation, 警告 = 0 = Len() Exit Sub Else 39。 增加 !类型 = = 增加 = True = True = True = False = End If 39。 这个 Form_Load 是刷新 list 列表用的 Form_Load MsgBox 设置成功。 , vbOKOnly + vbInformation, 提示 Else 28 = InputBox(输入考试类型。 , 输入 ) If = Then MsgBox 类型名称不能为空。 , vbOKOnly + vbExclamation, 警告 Exit Sub End If = 加入列表 = False = False = False = True End If End Sub Private Sub Command2_Click() If = Then MsgBox 你还没有 选择记录。 , vbOKOnly + vbExclamation, 警告 Else If MsgBox(确定要删除 类型名称 为 amp。 () amp。 的记录吗。 , vbOKCancel + vbExclamation, 警告 ) = vbOK Then = select * from leixing where 类型 =39。 amp。 () amp。 39。 = End If End If 39。 这个 Form_Load 是刷新 list 列表用的 Form_Load End Sub Private Sub Command3_Click() If = Then MsgBox 你还没有选择记录。 , vbOKOnly + vbExclamation, 警告 Exit Sub End If If = 保存修改 Then = select * from leixing where 类型 =39。 amp。 amp。 39。 29 39。 判断是否重复 If = False Then MsgBox 已经存在该类型名称。 , vbOKOnly + vbExclamation, 警告 = 0 = Len() Exit Sub Else 39。 修改 = select * from leixing where 类型 =39。 amp。 () amp。 39。 !类型 = = = 修改 = True = True = True = End If 39。 这个 Form_Load 是刷新 list 列表用的 Form_Load MsgBox 修改成功。 , vbOKOnly + vbInformation, 提示 Else = 0 = Len() If = Then MsgBox 类型名称不能为空。 , vbOKOnly + vbExclamation, 警告 Exit Sub End If = False = False = 保存修改 = False 30 = True End If End Sub Private Sub Command4_Click() Unload Me End Sub Private Sub Command5_Click() If = 加入列表 Then 39。 取消添加 = False = True = True = 增加 = True = Else 39。 取消修改 = False = 修改 = True = True = True = End If End Sub Private Sub Form_Load() 39。 打开数据库中的 leixing表 OpenTable Adodc1, leixing If = False Then Do While Not (0) Loop End If 31 End Sub Private Sub List1_Click() = () End Sub 4. 学。
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。