Private Sub Command3_Click()
Unload Me
End Sub
Private Sub Form_Load()
Dim i, j As Integer
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=信息.mdb;Persist Security Info=False"
Combo1.AddItem ("专业")
Combo1.AddItem ("年级")
Combo1.AddItem ("课程名称")
Combo1.AddItem ("教材")
Combo1.AddItem ("任课老师")
Combo1.AddItem ("课程性质")
Combo1.AddItem ("考试性质")
Combo2.AddItem ("=")
Combo3.AddItem ("专业")
Combo3.AddItem ("年级")
Combo3.AddItem ("课程名称")
Combo3.AddItem ("教材")
Combo3.AddItem ("任课老师")
Combo3.AddItem ("课程性质")
Combo3.AddItem ("考试性质")
Combo4.AddItem ("=")
Combo1.Text = ""
Combo2.Text = ""
Text1.Text = ""
Combo3.Text = ""
Combo4.Text = ""
Text2.Text = ""
End Sub
班级管理:班级设置、班级查询
运行程序后,进入班级管理模块,班级管理模块的班级增加,在这模块中可以把专业、年级、人数、班主任、备注等信息输入,以便使用。
Dim myCon As New ADODB.Connection
Dim myRs As New ADODB.Recordset
Private Sub Command1_Click()
Dim NianJi, ZhuanYe, RenShu, FuDaoYuan, BeiZu As String
NianJi = Text1.Text
ZhuanYe = Text2.Text
RenShu = Text3.Text
FuDaoYuan = Text4.Text
BeiZu = Text5.Text
Command1.Enabled = True
If Trim(NianJi) = "" Or Trim(ZhuanYe) = "" Or Trim(RenShu) = "" Or Trim(FuDaoYuan) = "" Then
MsgBox "资料不能为空,请填写完!"
Exit Sub
End If
myCon.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=信息.mdb;"
myRs.Open "select * from 班级表 where 年级='" & Trim(Text1.Text) & "' and 专业='" & Trim(Text2.Text) & "' ", myCon
If myRs.EOF = False Then
MsgBox "该班级已经存在,请重新输入!"
myRs.Close
myCon.Close
Text1.SetFocus
Exit Sub
End If
myRs.Close
myRs.Open "班级表", myCon, 3, 2
myRs.AddNew
myRs.Fields("年级") = Text1.Text
myRs.Fields("专业") = Text2.Text
myRs.Fields("人数") = Text3.Text
myRs.Fields("辅导员") = Text4.Text
If Text5.Text = "" Then
myRs.Fields("备注") = " "
Else
myRs.Fields("备注") = Text5.Text
End IfmyRs.Update
myRs.Close
myCon.Close
MsgBox "添加成功!"
Adodc1.RecordSource = "select * from 班级表 order by 年级"
Frm_AddClass.Adodc1.Refresh
Frm_AddClass.DataGrid1.RefreshText1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
End SubPrivate Sub Command2_Click()
Dim NianJi, xi, RenShu, FuDaoYuan, BeiZu As StringNianJi = Text1.Text
ZhuanYe = Text2.Text
RenShu = Text3.Text
FuDaoYuan = Text4.Text
BeiZu = Text5.TextIf Trim(NianJi) = "" Or Trim(ZhuanYe) = "" Or Trim(RenShu) = "" Or Trim(FuDaoYuan) = "" Then
MsgBox "请填写要删除资料!"
Exit Sub
End If
上一页 [1] [2] [3] [4] [5] [6] 下一页