图8
下面为其部分源代码:
Private Sub Command1_Click() For j = 0 To 5
If Text1(j) = \
ss = MsgBox(Label2(j).Caption & \不能为空!\警告\
Text1(j).SetFocus Text1(j).SelStart = 0
Text1(j).SelLength = Len(Text1(j).Text) Exit Sub End If Next
Dim mrc As ADODB.Recordset If classmodi = False Then
classstr = \班级='\ Set mrc = ExecuteSQL(classstr) If mrc.EOF = False Then
sss = MsgBox(\已经存在该班级的设置,不能重复!\警告\ Text1(1).SetFocus
Text1(1).SelStart = 0
Text1(1).SelLength = Len(Text1(1).Text) mrc.Close Exit Sub End If End If
19
classstr = \班级='\Set mrc = ExecuteSQL(classstr) classstr = \Set mrc = ExecuteSQL(classstr)
mrc.AddNew
For i = 0 To 6
If Text1(6).Text = \ Text1(6).Text = \无\ End If
mrc.Fields(i) = Text1(i).Text Next i mrc.Update
If classmodi Then Unload Me
'Formclass2.classshowtitle 'Formclass2.classshowdata Else
For j = 0 To 6 Text1(j) = \Next
'MDIForm1.classbrowse_Click End If End Sub
3.查询班级信息窗体的创建 查询班级信息窗体界面如图9
图9
下面为其部分源代码:
Private Sub Command1_Click() txtsql = \
If Text1(0).Text <> \
If txtsql = \
20
txtsql = \年级='\ Else
txtsql = txtsql & \年级='\ End If End If
If Text1(1).Text <> \
If txtsql = \
txtsql = \班级='\ Else
txtsql = txtsql & \班级='\ End If End If
If Text1(2).Text <> \ aa = 1
If txtsql = \
txtsql = \专业='\ Else
txtsql = txtsql & \专业='\ End If End If
If txtsql = \
ss = MsgBox(\你至少要输入一个条件以上才能查询!\警告\ Text1(0).SetFocus Exit Sub End If
txtsql = \Dim mrc As ADODB.Recordset Set mrc = ExecuteSQL(txtsql) If mrc.EOF = True Then
zzz = MsgBox(\对不起,没有此班级的档案记录!\查询\ Formclass3.ZOrder (0)
Formclass3.Text1(0).SetFocus Exit Sub End If
Formclass2.printstr = txtsql classfind = True Formclass2.Show
Formclass2.classshowtitle Formclass2.classshowdata
Formclass2.Caption = \班级设置查询结果\
21
Formclass2.ZOrder (0) End Sub
6.4 档案信息管理模块
档案信息管理模块主要实现的功能
? 添加档案信息 ? 浏览档案信息 ? 查询档案信息
1. 添加档案信息窗体的创建 添加档案信息窗体界面如图10
图10
下面为其部分源代码:
Private Sub Command1_Click() For j = 0 To 7
If Text1(j) = \
ss = MsgBox(Label1(j).Caption & \不能为空!\警告\
Text1(j).SetFocus Text1(j).SelStart = 0
Text1(j).SelLength = Len(Text1(j).Text) Exit Sub End If
22
Next
Dim mrc As ADODB.Recordset
txtsql1 = \学号='\ Set mrc = ExecuteSQL(txtsql1) If modi = False Then
If mrc.EOF = False Then
sss = MsgBox(\已经存在该学号的记录,学号不能重复!\\警告\
Text1(0).SetFocus
Text1(0).SelStart = 0
Text1(0).SelLength = Len(Text1(0).Text) mrc.Close Exit Sub End If End If
If Not IsDate(Text1(2).Text) Then '判断是否日期格式
ssss = MsgBox(\应输入日期 mm-dd-yy\警告\ Text1(2).SetFocus
Text1(2).SelStart = 0
Text1(2).SelLength = Len(Text1(2).Text) Exit Sub End If
If Not IsDate(Text1(6).Text) Then
ssss = MsgBox(\应输入日期 mm-dd-yy\警告\ Text1(6).SetFocus
Text1(6).SelStart = 0
Text1(6).SelLength = Len(Text1(6).Text) Exit Sub End If
If modi = True Then
txtsql1 = \学号='\姓名='\Trim(Text1(1).Text) & \性别='\班级='\
Trim(Combo1(1).Text) & \出生年月=#\家庭住址='\Trim(Text1(3).Text) & \邮政编码='\联系电话='\Trim(Text1(5).Text) & \入学时间=#\备注='\Trim(Text1(7).Text) & \学号='\& Trim(Form3.MSF1.TextMatrix(Form3.MSF1.Row, 1)) & \
Set mrc = ExecuteSQL(txtsql1)
txtsql1 = \学号='\学号='\
23
百度搜索“77cn”或“免费范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,免费范文网,提供经典小说综合文库基于VB的学生信息管理系统(5)在线全文阅读。
相关推荐: