copyright paper51.com http://www.paper51.com 4.2.2.管理员管理模块 内容来自论文无忧网 www.paper51.com
内容来自www.paper51.com 图4-2-2管理员添加窗口图 paper51.com
此界面是为了保证系统的可管理性,实现多用户的管理。 copyright paper51.com PrivateSub Command1_Click() paper51.com Dimsql As String http://www.paper51.com Dimrs_add As New ADODB.Recordset copyright paper51.com IfTrim(Text1.Text) = "" Then http://www.paper51.com MsgBox "用户名不能为空",vbOKOnly + vbExclamation, "" 内容来自www.paper51.com Exit Sub 内容来自论文无忧网 www.paper51.com Text1.SetFocus copyright paper51.com Else copyright paper51.com
sql = "select * from 系统管理" http://www.paper51.com rs_add.Open sql, conn,adOpenKeyset, adLockPessimistic 内容来自www.paper51.com
While (rs_add.EOF = False) 内容来自论文无忧网 www.paper51.com IfTrim(rs_add.Fields(0)) = Trim(Text1.Text) Then paper51.com MsgBox "已有这个用户", vbOKOnly + vbExclamation,"" http://www.paper51.com Text1.SetFocus 内容来自www.paper51.com Text1.Text = "" 内容来自www.paper51.com
Text2.Text= "" paper51.com
Text3.Text = "" copyright paper51.com Exit Sub paper51.com Else http://www.paper51.com rs_add.MoveNext copyright paper51.com End If 内容来自www.paper51.com Wend 内容来自www.paper51.com If Trim(Text2.Text) <>Trim(Text3.Text) Then copyright paper51.com
MsgBox"两次密码不一致",vbOKOnly + vbExclamation, "" http://www.paper51.com Text2.SetFocus 内容来自www.paper51.com Text2.Text= "" 内容来自论文无忧网 www.paper51.com
Text3.Text= "" paper51.com Exit Sub 内容来自www.paper51.com Else 内容来自www.paper51.com rs_add.AddNew paper51.com rs_add.Fields(0) = Text1.Text 内容来自论文无忧网 www.paper51.com rs_add.Fields(1) = Text2.Text paper51.com rs_add.Update paper51.com rs_add.Close 内容来自www.paper51.com MsgBox"添加用户成功",vbOKOnly + vbExclamation, "" 内容来自论文无忧网 www.paper51.com
Unload Me http://www.paper51.com
End If http://www.paper51.com EndIf http://www.paper51.com EndSub 内容来自www.paper51.com
PrivateSub Command2_Click() 内容来自论文无忧网 www.paper51.com
UnloadMe http://www.paper51.com EndSub 内容来自论文无忧网 www.paper51.com 4.2.3.学生管理界面模块 paper51.com 此模块主要是包括对学生的信息的添加、删除、查找。并能查看每个学生的所有平时表现。为教师在书写评语时提供依据。 内容来自论文无忧网 www.paper51.com http://www.paper51.com 图4-2-3-1学生添加窗口图 内容来自www.paper51.com
copyright paper51.com
图4-2-3-2学生管理查找学生窗口图 copyright paper51.com 查询时用户根据需要查询的条件进行查询,可以选择按姓名、按班级、按学号,这时学生的信息将全部显示在List1窗口中,点击学生时在Text4会显示学生平时的表现信息。代码以上所示。 内容来自论文无忧网 www.paper51.com PrivateSub Command1_Click() 内容来自论文无忧网 www.paper51.com Dimrs As New ADODB.Recordset paper51.com Dimfind As String 内容来自论文无忧网 www.paper51.com Dimsql As String paper51.com List1.Clear 内容来自www.paper51.com List1.AddItem"学号"& Space(5) & "姓名"& Space(5) & "班级" copyright paper51.com IfOption1.Value = True Then 内容来自www.paper51.com sql = "select * from 学生管理 where 学生姓名='"& Text1.Text & "'" http://www.paper51.com
rs.Open sql, conn, adOpenKeyset,adLockPessimistic paper51.com
If rs.EOF = False Then paper51.com rs.MoveFirst 内容来自论文无忧网 www.paper51.com While rs.EOF =False copyright paper51.com List1.AddItem rs.Fields(0) & Space(5) & rs.Fields(1) &Space(5) & rs.Fields(2) http://www.paper51.com rs.MoveNext copyright paper51.com Wend copyright paper51.com Text1.Text ="" 内容来自论文无忧网 www.paper51.com Else copyright paper51.com
MsgBox "没有找到目标!", vbOKOnly + vbExclamation,"" copyright paper51.com End If http://www.paper51.com EndIf paper51.com IfOption2.Value = True Then http://www.paper51.com
sql = "select * from 学生管理 where 学号='"& Text2.Text & "'" copyright paper51.com
rs.Open sql, conn, adOpenKeyset,adLockPessimistic 内容来自www.paper51.com If rs.EOF = False Then paper51.com rs.MoveFirst paper51.com While rs.EOF = False http://www.paper51.com List1.AddItem rs.Fields(0) & Space(5) & rs.Fields(1) &Space(5) & rs.Fields(2) paper51.com rs.MoveNext copyright paper51.com Wend 内容来自论文无忧网 www.paper51.com Text2.Text = "" copyright paper51.com
Else http://www.paper51.com MsgBox "没有找到目标!", vbOKOnly + vbExclamation,"" http://www.paper51.com
End If copyright paper51.com
EndIf 内容来自www.paper51.com IfOption3.Value = True Then 内容来自www.paper51.com sql = "select * from 学生管理 where 班级='"& Text3.Text & "'" paper51.com rs.Open sql, conn, adOpenKeyset,adLockPessimistic paper51.com If rs.EOF = False Then http://www.paper51.com rs.MoveFirst 内容来自www.paper51.com While rs.EOF = False http://www.paper51.com List1.AddItem rs.Fields(0) & Space(5) & rs.Fields(1) &Space(5) & rs.Fields(2) paper51.com
rs.MoveNext 内容来自www.paper51.com Wend copyright paper51.com Text3.Text ="" 内容来自论文无忧网 www.paper51.com Else 内容来自论文无忧网 www.paper51.com MsgBox "没有找到目标!", vbOKOnly + vbExclamation,"" 内容来自论文无忧网 www.paper51.com
End If copyright paper51.com
EndIf copyright paper51.com rs.Close 内容来自www.paper51.com
EndSub 内容来自论文无忧网 www.paper51.com PrivateSub Command2_Click() http://www.paper51.com UnloadMe 内容来自www.paper51.com
EndSub copyright paper51.com
PrivateSub List1_Click() paper51.com Dimi As Long 内容来自www.paper51.com Dimsql As String 内容来自www.paper51.com
Dimrsclick As New ADODB.Recordset paper51.com
i= CLng(List1.ListIndex) paper51.com
ID= Left(List1.Text, 6) 内容来自www.paper51.com
Ifi > 0 Then 内容来自www.paper51.com
rsclick.CursorLocation =adUseClient http://www.paper51.com
sql = "select * from 学生操行 where 学号='"& ID & "'" & " order by 学期" paper51.com
rsclick.Open sql, conn,adOpenKeyset, adLockPessimistic http://www.paper51.com If rsclick.EOF = False Then 内容来自www.paper51.com rsclick.MoveFirst 内容来自论文无忧网 www.paper51.com
Else 内容来自www.paper51.com MsgBox "该生没有评语!", vbOKOnly + vbExclamation,"" paper51.com Exit Sub 内容来自论文无忧网 www.paper51.com End If 内容来自www.paper51.com Text4.Text = "" '文本框清空 copyright paper51.com While rsclick.EOF = False 内容来自论文无忧网 www.paper51.com Text4.Text =Text4.Text & vbCrLf & "第"& rsclick.Fields(1) & "条记录"& vbCrLf & Space(2) & _ copyright paper51.com rsclick.Fields(2) & vbCrLf & Space(10) & rsclick.Fields(3)& Space(2) & rsclick.Fields(4) copyright paper51.com rsclick.MoveNext copyright paper51.com
Wend copyright paper51.com
rsclick.Close 内容来自论文无忧网 www.paper51.com Exit Sub 内容来自www.paper51.com Else paper51.com MsgBox "请选择学生!", vbOKOnly + vbExclamation,"" 内容来自www.paper51.com
ExitSub paper51.com EndIf copyright paper51.com EndSub paper51.com |