图4
下面为部分源代码:
Private Sub Command1_Click() Dim mrc As ADODB.Recordset
txtsql = \Set mrc = ExecuteSQL(txtsql) If mrc.EOF = True Then
MsgBox \用户名错误!\警告\ Text1.SetFocus Text1.SelStart = 0
Text1.SelLength = Len(Text1.Text) Exit Sub End If
username = mrc.Fields(0)
txtsql = \Set mrc = ExecuteSQL(txtsql) If mrc.EOF = True Then
MsgBox \密码错误!\警告\ Text2.SetFocus Text2.SelStart = 0
Text2.SelLength = Len(Text2.Text) Exit Sub End If
MDIForm1.Show Unload Me End Sub
2.添加用户窗体的创建 添加用户窗体界面如图5
14
图5
下面为其部分源代码:
Private Sub Command1_Click() If Trim(Text1(0).Text) = \
MsgBox \用户名不能为空!\警告\ Text1(0).SetFocus Exit Sub End If
If Trim(Text1(1).Text) = \
MsgBox \密码不能为空!\警告\ Text1(1).SetFocus Exit Sub End If
If Trim(Text1(2).Text) = \
MsgBox \确认密码不能为空!\警告\ Text1(2).SetFocus Exit Sub End If
If Trim(Text1(1).Text) <> Trim(Text1(2).Text) Then
MsgBox \确认密码不正确!\警告\ Text1(2).SetFocus Exit Sub End If
Dim aa As Integer aa = 0
If Option1(2).Value = True Then For i = 0 To 3
If Check1(i).Value = 1 Then
15
aa = 1 Exit For End If Next i
If aa = 0 Then
MsgBox \普通用户至少要有一项权限!\警告\Exit Sub End If End If
Dim mrc As ADODB.Recordset
txtsql = \Set mrc = ExecuteSQL(txtsql) If mrc.EOF = False Then
MsgBox \已存在该用户!\警告\ Text1(0).SetFocus Text1(0).SelStart = 0
Text1(0).SelLength = Len(Text1(0).Text) Exit Sub End If
txtsql = \Set mrc = ExecuteSQL(txtsql) mrc.AddNew
mrc.Fields(0) = Trim(Text1(0).Text) mrc.Fields(1) = Trim(Text1(1).Text) For i = 0 To 2
If Option1(i).Value = True Then Select Case i Case 0
mrc.Fields(\ Case 1
mrc.Fields(\ Case 2
For j = 0 To 3
If Check1(j).Value = 1 Then Select Case j Case 0
mrc.Fields(\ Case 1
mrc.Fields(\ Case 2
mrc.Fields(\ Case 3
mrc.Fields(\
16
End Select End If Next j End Select
End If Next i
mrc.Update
MsgBox \用户添加成功!\警告\ Text1(0).Text = \ Text1(1).Text = \ Text1(2).Text = \End Sub
3.修改用户密码窗体的创建 修改用户密码窗体界面如图6
图6
下面为其部分源代码:
Private Sub Command1_Click() pass1 = Trim(Text1.Text) pass2 = Trim(Text2.Text)
If pass1 = pass2 Then
Dim mrc As ADODB.Recordset
txtsql = %username,password from use where username='\& username & \ Set mrc = ExecuteSQL(txtsql) If mrc.EOF Then
MsgBox \此用户不存在\ Else
mrc.Fields(1) = pass1 mrc.Update
17
MsgBox \修改成功\密码\ End If
Unload Me Else
If MsgBox(\两次密码不一致\错误\ Unload Me Else
Text1.Text = \ Text2.Text = \ Text1.SetFocus End If End If End Sub
6.3 班级管理模块
班级管理模块主要实现的功能
? 班级浏览 ? 添加班级 ? 班级查询
1.浏览班级信息窗体的创建 浏览班级信息窗体界面如图7
图7
2.添加班级信息窗体的创建 添加班级信息窗体界面如图8
18
百度搜索“77cn”或“免费范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,免费范文网,提供经典小说综合文库基于VB的学生信息管理系统(4)在线全文阅读。
相关推荐: