学生学籍成绩管理系统源程序

上传人:我*** 文档编号:136120857 上传时间:2020-06-24 格式:DOC 页数:37 大小:109KB
返回 下载 相关 举报
学生学籍成绩管理系统源程序_第1页
第1页 / 共37页
学生学籍成绩管理系统源程序_第2页
第2页 / 共37页
学生学籍成绩管理系统源程序_第3页
第3页 / 共37页
学生学籍成绩管理系统源程序_第4页
第4页 / 共37页
学生学籍成绩管理系统源程序_第5页
第5页 / 共37页
点击查看更多>>
资源描述

《学生学籍成绩管理系统源程序》由会员分享,可在线阅读,更多相关《学生学籍成绩管理系统源程序(37页珍藏版)》请在金锄头文库上搜索。

1、模块1:Option ExplicitPublic con As ADODB.ConnectionPublic rs As ADODB.RecordsetPublic username As StringPublic usergrade As StringPublic userpwd As StringPublic cmd As ADODB.Command模块2Option ExplicitSub hidewindow() With ActiveWindow .DisplayGridlines = False .DisplayHeadings = False .DisplayOutline =

2、 False .DisplayZeros = False .DisplayHorizontalScrollBar = False .DisplayVerticalScrollBar = False .DisplayWorkbookTabs = False End WithEnd SubSub showwindow() With ActiveWindow .DisplayGridlines = True .DisplayHeadings = True .DisplayOutline = True .DisplayZeros = True .DisplayHorizontalScrollBar =

3、 True .DisplayVerticalScrollBar = True End WithEnd Sub模块3:Sub Macro1() Range(D2:D60000).Select With Selection.Validation .Delete .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _ xlBetween, Formula1:=团员,党员,预备党员,群众 .IgnoreBlank = True .InCellDropdown = True .InputTitle = .ErrorTit

4、le = .InputMessage = .ErrorMessage = .IMEMode = xlIMEModeNoControl .ShowInput = True .ShowError = True End With End SubSub Macro2() Range(J2:J60000).Select With Selection.Validation .Delete .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _ xlBetween, Formula1:=本科,专科 .IgnoreBlank

5、= True .InCellDropdown = True .InputTitle = .ErrorTitle = .InputMessage = .ErrorMessage = .IMEMode = xlIMEModeNoControl .ShowInput = True .ShowError = True End With End SubSub Macro3() Range(K2:K60000).Select With Selection.Validation .Delete .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop,

6、Operator:= _ xlBetween, Formula1:=在校,休学,毕业 .IgnoreBlank = True .InCellDropdown = True .InputTitle = .ErrorTitle = .InputMessage = .ErrorMessage = .IMEMode = xlIMEModeNoControl .ShowInput = True .ShowError = True End With End SubUserForm1代码:Option ExplicitPrivate Sub CommandButton1_Click()On Error Go

7、To doerrorDim sql As StringSet con = New ADODB.ConnectionSet rs = New ADODB.Recordsetcon.Open Provider=Microsoft.Jet.OLEDB.4.0;Data source= & ThisWorkbook.Path & xjcj.mdbsql = select * from 用户数据表 where 用户名= & UserForm1.ComboBox1.Text & rs.Open sql, con, adOpenKeyset, adLockOptimisticIf UserForm1.Com

8、boBox1.Text = Then MsgBox 用户名不能为空! UserForm1.ComboBox1.SetFocus Exit SubEnd IfIf UserForm1.TextBox2.Text = Then MsgBox 密码不能为空! UserForm1.TextBox2.SetFocus Exit SubEnd IfIf Trim(rs.Fields(密码) = Trim(UserForm1.TextBox2.Text) Then username = Trim(rs.Fields(用户名) usergrade = Trim(rs.Fields(权限) userpwd =

9、Trim(rs.Fields(密码) Workbooks.Application.Visible = True Sheets(目录).Activate Me.Hide Unload MeElse MsgBox 密码错误 TextBox2.Text = TextBox2.SetFocusExit SubEnd Ifrs.Closecon.CloseSet rs = NothingSet con = NothingExit Subdoerror:MsgBox 系统出现错误End SubPrivate Sub CommandButton2_Click()ActiveWorkbook.SaveAppl

10、ication.QuitEnd SubPrivate Sub UserForm_Initialize()Dim i As IntegerSet con = New ADODB.ConnectionSet rs = New ADODB.Recordsetcon.Open Provider=Microsoft.Jet.OLEDB.4.0;Data source= & ThisWorkbook.Path & xjcj.mdbrs.Open select * from 用户数据表 , con, adOpenKeyset, adLockOptimisticFor i = 1 To rs.RecordCo

11、untUserForm1.ComboBox1.AddItem rs.Fields(用户名)rs.MoveNextNext irs.Closecon.CloseSet rs = NothingSet con = NothingEnd SubUserForm2代码:Option ExplicitPrivate Sub CommandButton1_Click()On Error Resume NextApplication.ScreenUpdating = FalseDim sql As StringSet con = New ADODB.ConnectionSet rs = New ADODB.

12、RecordsetSet cmd = New ADODB.Commandcon.Open Provider=Microsoft.Jet.OLEDB.4.0;Data source= & ThisWorkbook.Path & xjcj.mdbSet cmd.ActiveConnection = conIf UserForm2.TextBox1.Text = Or UserForm2.TextBox2.Text = Or UserForm2.TextBox3.Text = Then MsgBox 更改信息不齐全!, 48 Exit Sub End IfIf userpwd = Trim(User

13、Form2.TextBox1.Text) Then If Trim(UserForm2.TextBox2) = Trim(UserForm2.TextBox3) Then cmd.CommandText = update 用户数据表 set 密码= & UserForm2.TextBox2.Text & where 用户名= & username & cmd.Execute MsgBox 密码更换成功!请牢记密码! Unload Me Else MsgBox 确认密码输入有误,请重新输入! UserForm2.TextBox3.SetFocus End IfElse MsgBox 原密码输入错误,请重新输入! UserForm2.TextBox1.SetFocus End I

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

当前位置:首页 > 办公文档 > 事务文书

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