vb和SQL做的学生成绩管理系统-.pdf

上传人:索**** 文档编号:76257695 上传时间:2023-03-08 格式:PDF 页数:21 大小:3.33MB
返回 下载 相关 举报
vb和SQL做的学生成绩管理系统-.pdf_第1页
第1页 / 共21页
vb和SQL做的学生成绩管理系统-.pdf_第2页
第2页 / 共21页
点击查看更多>>
资源描述

《vb和SQL做的学生成绩管理系统-.pdf》由会员分享,可在线阅读,更多相关《vb和SQL做的学生成绩管理系统-.pdf(21页珍藏版)》请在得力文库 - 分享文档赚钱的网站上搜索。

1、Form1的代码:Private Sub Command1_Click()Unload Me Form3.Show End Sub Private Sub Command2_Click()Unload Me Form2.Show End Sub Private Sub Command3_Click()If MsgBox(确定退出管理系统?,_ vbQuestion+vbYesNo+vbDefaultButton2,警告!)=vbYes Then End End If End Sub Private Sub Picture1_Click()End Sub Private Sub Timer1_T

2、imer()Command4.Caption=Time$()End Sub Private Sub Form_Load()Timer1.Interval=1000 Timer1.Enabled=True End Sub Form2 的代码:Private Sub Command1_Click()Adodc1.Recordset.MoveFirst Adodc1.Recordset.Find 用户名=&Text1.Text&If Adodc1.Recordset.EOF=True Then Adodc1.Recordset.MoveFirst If(Trim(Text1.Text)=(Trim(

3、Text3.Text)And(Trim(Text2.Text)=(Trim(Text4.Text)Then Adodc1.Enabled=False Form4.Text3.Text=Text1.Text Unload Me Form8.Show Else MsgBox 非法的账号!,vbOKOnly+vbExclamation,请重新输入!Text1.Text=Text2.Text=Text1.SetFocus End If End Sub Private Sub Command2_Click()Text1.Text=Text2.Text=End Sub Private Sub Comman

4、d3_Click()Unload Me Form1.Show End Sub Private Sub Form_Load()Text2.Text=Text1.Text=Text2.PasswordChar=*End Sub Private Sub Picture1_Click()End Sub Form3 的代码:Private Sub Command1_Click()Adodc1.Recordset.MoveFirst Adodc1.Recordset.Find 用户名=&Text1.Text&If Adodc1.Recordset.EOF=True Then Adodc1.Recordse

5、t.MoveFirst If(Trim(Text1.Text)=(Trim(Text3.Text)And(Trim(Text2.Text)=(Trim(Text4.Text)Then Adodc1.Enabled=False Form4.Text1.Text=Text1.Text Form4.Text2.Text=Text4.Text Unload Me Form5.Show Else MsgBox 非法的账号!,vbOKOnly+vbExclamation,请重新输入!Text1.Text=Text2.Text=Text1.SetFocus End If End Sub Private Su

6、b Command2_Click()Option1.Value=False Option2.Value=False Text1.Text=Text2.Text=End Sub Private Sub Command3_Click()Unload Me Form1.Show End Sub Private Sub Form_Load()Text2.Text=Text1.Text=Text2.PasswordChar=*End Sub 无代码Form5 的代码:Private Sub cjcx_Click(Index As Integer)Unload Me Form7.Show End Sub

7、Private Sub Command1_Click()On Error Resume Next If Command1.Caption=修改 Then Command1.Caption=确认 Adodc2.Recordset.Requery Text5.SetFocus Else Command1.Caption=修改 Adodc2.Recordset.Update MsgBox 修改成功 End If End Sub Private Sub Form_Load()Adodc1.CommandType=adCmdUnknown Adodc1.RecordSource=Select*From

8、studentwel Where 用户名=&Form4.Text1.Text&Adodc1.Refresh Text1.Visible=True Text3.Visible=True Timer1.Interval=1000 Timer1.Enabled=True End Sub Private Sub Picture1_Click()End Sub Private Sub tcxt_Click(Index As Integer)Unload Me Form3.Show End Sub Private Sub Timer1_Timer()Text2.Text=Time$()End Sub Pr

9、ivate Sub xgmm_Click()Label5.Visible=True Label7.Visible=True Text4.Visible=True Text5.Visible=True Command1.Visible=True Adodc2.CommandType=adCmdUnknown Adodc2.RecordSource=Select*From studententer Where 用户名=&Form4.Text1.Text&Adodc2.Refresh End Sub Private Sub xxcx_Click(Index As Integer)Unload Me

10、Form6.Show End Sub Form6 的代码:Private Sub Command1_Click()Unload Me Form5.Show End Sub Private Sub Command2_Click()On Error Resume Next If Command2.Caption=修改 Then Text1.SetFocus Command2.Caption=确认 Adodc1.Recordset.Requery MsgBox 信息修改成功 Else Command2.Caption=修改 Adodc1.Recordset.Update End If End Sub

11、 Private Sub Form_Load()Adodc1.CommandType=adCmdUnknown Adodc1.RecordSource=Select*From studentinfor Where 学号=&Form4.Text1.Text&Adodc1.Refresh Text1.Visible=True Text2.Visible=True Text3.Visible=True Text4.Visible=True Text5.Visible=True Text6.Visible=True Text7.Visible=True Text8.Visible=True End S

12、ub Private Sub Picture1_Click()End Sub Private Sub Command1_Click()Unload Me Form5.Show End Sub Private Sub Form_Load()Adodc1.Recordset.MoveFirst Dim a As String a=Form4.Text1.Text Adodc1.Recordset.Find 学号=&a&Text1.Visible=True Text2.Visible=True Text4.Visible=True Text6.Visible=True Dim b As Intege

13、r b=Text2.Text If b=90 Then Text3.Text=优 ElseIf b=80 Then Text3.Text=良 ElseIf b=70 Then Text3.Text=中 ElseIf b=60 Then Text3.Text=及格 Else Text3.Text=不及格 End If Dim c As Integer c=Text4.Text If c=90 Then Text5.Text=优 ElseIf c=80 Then Text5.Text=良 ElseIf c=70 Then Text5.Text=中 ElseIf c=60 Then Text5.Te

14、xt=及格 Else Text5.Text=不及格 End If Dim d As Integer d=Text6.Text If d=90 Then Text7.Text=优 ElseIf d=80 Then Text7.Text=良 ElseIf d=70 Then Text7.Text=中 ElseIf d=60 Then Text7.Text=及格 Else Text7.Text=不及格 End If If Text3.Text=不及格 Then Text2.ForeColor=&HFF&End If If Text5.Text=不及格 Then Text4.ForeColor=&HF

15、F&End If If Text7.Text=不及格 Then Text6.ForeColor=&HFF&End If End Sub Private Sub Picture1_Click()End Sub Form8 的代码:Private Sub Command1_Click()On Error Resume Next If Command1.Caption=修改 Then Command1.Caption=确认 Adodc1.Recordset.Requery Text2.SetFocus Else Command1.Caption=修改 Adodc1.Recordset.Update

16、MsgBox 修改成功 End If End Sub Private Sub file1_Click()Unload Me Form10.Show End Sub Private Sub file2_Click()Unload Me Form9.Show End Sub Private Sub file4_Click()Unload Me Form12.Show End Sub Private Sub file5_Click()Unload Me Form11.Show End Sub Private Sub file7_Click()Unload Me Form2.Show End Sub

17、Private Sub file8_Click()Label3.Visible=True Label4.Visible=True Text1.Visible=True Text2.Visible=True Command1.Visible=True Adodc1.CommandType=adCmdUnknown Adodc1.RecordSource=Select*From teacherenter Where 用户名=&Form4.Text3.Text&Adodc1.Refresh End Sub Private Sub Picture1_Click()End Sub Form9 的代码:P

18、rivate Sub Command1_Click()Dim mno As String mno=InputBox(请输入学号,查找窗)Adodc1.Recordset.MoveFirst Adodc1.Recordset.Find 学号=&mno&If Adodc1.Recordset.EOF=True Then MsgBox 无此学号!,提示 End Sub Private Sub Command2_Click()Unload Me Form8.Show End Sub Private Sub Command3_Click()Dim mnon As String mnon=InputBox

19、(请输入姓名,查找窗)Adodc1.Recordset.MoveFirst Adodc1.Recordset.Find 姓名=&mnon&If Adodc1.Recordset.EOF=True Then MsgBox 无此学号!,提示 End Sub Private Sub Label5_Click()End Sub Private Sub Label7_Click()End Sub Form10 的代码:Private Sub Command1_Click()On Error Resume Next Command2.Enabled=Not Command2.Enabled Command

20、3.Enabled=Not Command3.Enabled Command4.Enabled=Not Command4.Enabled If Command1.Caption=新增 Then Command1.Caption=确认 Adodc1.Recordset.AddNew Text1.SetFocus Else Command1.Caption=新增 Adodc1.Recordset.Update Adodc1.Recordset.MoveLast End If End Sub Private Sub Command2_Click()On Error Resume Next Adodc

21、1.Recordset.Delete Adodc1.Recordset.MoveNext If Adodc1.Recordset.EOF Then Adodc1.Recordset.MoveLast End If End Sub Private Sub Command3_Click()On Error Resume Next Command1.Enabled=Not Command1.Enabled Command2.Enabled=Not Command2.Enabled Command4.Enabled=Not Command4.Enabled If Command3.Caption=修改

22、 Then Command3.Caption=确认 Adodc1.Recordset.Requery Text1.SetFocus Else Command3.Caption=修改 Adodc1.Recordset.Update End If End Sub Private Sub Command4_Click()On Error Resume Next Command1.Caption=新增 Command3.Caption=修改 Command1.Enabled=True Command2.Enabled=True Command3.Enabled=True Command4.Enable

23、d=True Adodc1.Recordset.CancelUpdate Adodc1.Recordset.MoveLast End Sub Private Sub Command5_Click()Unload Me Form8.Show End Sub Private Sub Command6_Click()Adodc1.Recordset.MovePrevious If Adodc1.Recordset.BOF Then Adodc1.Recordset.MoveLast End If End Sub Private Sub Command7_Click()Adodc1.Recordset

24、.MoveNext If Adodc1.Recordset.EOF Then Adodc1.Recordset.MoveFirst End If End Sub Private Sub Command8_Click()Adodc1.Recordset.MoveFirst End Sub Private Sub Command9_Click()Adodc1.Recordset.MoveLast End Sub Private Sub Label5_Click()End Sub Form11 的代码:Private Sub Command1_Click()Dim mno As String mno

25、=InputBox(请输入学号,查找窗)Adodc1.Recordset.MoveFirst Adodc1.Recordset.Find 学号=&mno&If Adodc1.Recordset.EOF=True Then MsgBox 无此学号!,提示 End Sub Private Sub Command2_Click()Unload Me Form8.Show End Sub Private Sub Picture1_Click()End Sub Form12 的代码:Private Sub Command1_Click()On Error Resume Next Command2.Ena

26、bled=Not Command2.Enabled Command3.Enabled=Not Command3.Enabled Command4.Enabled=Not Command4.Enabled If Command1.Caption=新增 Then Command1.Caption=确认 Adodc1.Recordset.AddNew Text1.SetFocus Else Command1.Caption=新增 Adodc1.Recordset.Update Adodc1.Recordset.MoveLast End If End Sub Private Sub Command2_

27、Click()On Error Resume Next Adodc1.Recordset.Delete Adodc1.Recordset.MoveNext If Adodc1.Recordset.EOF Then Adodc1.Recordset.MoveLast End If End Sub Private Sub Command3_Click()On Error Resume Next Command1.Enabled=Not Command1.Enabled Command2.Enabled=Not Command2.Enabled Command4.Enabled=Not Comman

28、d4.Enabled If Command3.Caption=修改 Then Command3.Caption=确认 Adodc1.Recordset.Requery Text1.SetFocus Else Command3.Caption=修改 Adodc1.Recordset.Update End If End Sub Private Sub Command4_Click()On Error Resume Next Command1.Caption=新增 Command3.Caption=修改 Command1.Enabled=True Command2.Enabled=True Comm

29、and3.Enabled=True Command4.Enabled=True Adodc1.Recordset.CancelUpdate Adodc1.Recordset.MoveLast End Sub Private Sub Command5_Click()Unload Me Form8.Show End Sub Private Sub Command6_Click()Adodc1.Recordset.MovePrevious If Adodc1.Recordset.BOF Then Adodc1.Recordset.MoveLast End If End Sub Private Sub Command7_Click()Adodc1.Recordset.MoveNext If Adodc1.Recordset.EOF Then Adodc1.Recordset.MoveFirst End If End Sub Private Sub Command8_Click()Adodc1.Recordset.MoveFirst End Sub Private Sub Command9_Click()Adodc1.Recordset.MoveLast End Sub Private Sub Picture1_Click()End Sub 数据库部分:建立数据库表:

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

当前位置:首页 > 技术资料 > 实施方案

本站为文档C TO C交易模式,本站只提供存储空间、用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。本站仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知得利文库网,我们立即给予删除!客服QQ:136780468 微信:18945177775 电话:18904686070

工信部备案号:黑ICP备15003705号-8 |  经营许可证:黑B2-20190332号 |   黑公网安备:91230400333293403D

© 2020-2023 www.deliwenku.com 得利文库. All Rights Reserved 黑龙江转换宝科技有限公司 

黑龙江省互联网违法和不良信息举报
举报电话:0468-3380021 邮箱:hgswwxb@163.com