排课管理系统_第1页
排课管理系统_第2页
排课管理系统_第3页
排课管理系统_第4页
排课管理系统_第5页
已阅读5页,还剩44页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、毕业设计毕业设计 院系院系_ 专业专业_ 班级班级_ 姓名姓名_日期日期 年年 月月 日日目 录摘 要 IABSTRACT II第一章 引言11.1 背景 11.1.1 教师管理系统11.2 开发教师管理系统的目的和原则31.3 开发环境介绍 31.3.1 开发平台41.3.2 数据库设计工具ACCESS 数据库管理系统 7第二章 系统设计 92.1 系统分析92.2 系统流程和操作方式设计11第三章 系统界面设计123.1 系统界面设计以及代码分析 12第四章 数据库的设计 304.1 数据库设计 304.2 数据库概念和发展304.3 系统测试与评价38总 结 39致 谢40参考文献 41

2、摘摘 要要20 世纪以来,社会生产力迅速发展,科学技术突飞猛进,人们进行信息交流的深度与广度不断增加,信息量急剧增长,传统的信息处理与决策的手段已不能适应社会的需要,信息的重要性和信息处理问题的紧迫性空前提高了,面对着日益复杂和不断发展,变化的社会环境,特别是企业间日趋剧烈的竞争形势,一个人、一个企业要在现代社会中求生存,求发展,必须具备足够的信息和强有力的信息收集与处理手段。对于一个学校来说,大量教师课程安排难于通过传统的方法进行管理;这就迫切需要利用计算机技术来帮助学校管理者来处理教师课程安排的日常管理,合理安排课程,防止课程冲突.排课管理系统可以很好的解决以上问题.排课管理系统是管理信息

3、系统的一个典型用例. 管理信息系统是一个集信息技术、经济管理理论、统计学与运筹学、数据库技术为一体的综合性系统,是一个资金技术密集型、劳动密集型、智力密集型的项目。我国拥有广阔的市场和丰富的人才资源,有几十年的技术积累和经验积累,有一定的后发优势。管理信息系统的创新工作既不能妄自菲薄,更不能夜郎自大。要抓住当前网络经济兴起的有利时机,以实现我国信息技术和信息产业的跨越式发展,更好地发挥信息产业对国民经济增长的拉动作用。开发学校排课管理系统的过程就是要实现数据处理方式由人工管理向计算机管理的转变,它在计算机技术和教师管理实践活动两者之间架设桥梁。关键字关键字: :排课管理排课管理, ,管理信息系

4、统管理信息系统, ,数据库数据库, ,计算机管理计算机管理第一章第一章 引言引言对于一个学校来说,大量教师课程安排难于通过传统的方法进行管理;这就迫切需要利用计算机技术来帮助学校管理者来处理教师课程安排的日常管理,合理安排课程,防止课程冲突.排课管理系统可以很好的解决以上问题.排课管理系统是管理信息系统的一个典型用例. 1.1 背景背景1.1.1 排课管理系统排课管理系统 如今随着教育事业的发展,学校对教师课程安排的复杂度的增加,一个单位,各个学科每天的课程安排以及教室资源的分配,排课工资等信息量将迅速的增加,传统的手工的处理方式已经跟不上信息爆炸般的扩增.所以开发一种可靠,高效的教师排课管理

5、系统是很有必要的.1.2 开发排课管理系统的目的与原则开发排课管理系统的目的与原则排课管理系统的主要目的是服务与中小学,各高校的管理者,方便其管理本校排课信息的软件系统.其原则是做到,界面友好人性,操作简单,可靠.1.3 开发环境介绍开发环境介绍1.3.1 开发平台开发平台 本教师管理系统的开发平台为微软 windows xp visual basic 6.0 以及微软的 Access 作为操作数据库.1.3.2数据库设计工具数据库设计工具ACCESSACCESS 数据库管理系统数据库管理系统 Microsoft Access 介绍:使用 Microsoft Access,可以在单一的数据库文

6、件中管理所有的信息。在这个文件中,用户可以将自己的数据分别保存在各自独立的存储空间中,这些空间称作表;可以使用联机窗体来查看、添加及更新表中的数据;使用查询来查找并检索所要的数据;也可以使用报表以特定的版面布置来分析及打印数据。 如果要保存数据,请为每一种类型的信息创建一个表。如果要从查询、窗体或报表中的多个表中将数据合并在一起,就要定义各个表之间的关系。 如果要搜索并检索符合指定条件的数据,包括来自多个表中的数据,就要创建查询。查询的同时也可以更新或删除多条记录,并对数据执行内嵌或自定义的计算。 如果要简单地直接在某个表中查看、输入及更改数据,请创建一个窗体。在打开一个窗体时,Microso

7、ft Access 将从一个或多个表中检索数据,并使用用户在“窗体向导”选择的版面布局或所创建的版面布局,将窗体显示在屏幕上。 如果要分析数据或将数据以特定的方式打印出来,请创建一个报表。例如,可以打印一份将数据分组并计算数据总和的报表,也可以打印另一份带有各种数据格式的打印邮件标签的报表。第二章第二章 系统设计系统设计2.1 系统分析系统分析本排课管理系统主要由以下几大模块构成.一.教职员入库信息.二.排课管理三.教职员带课查询四.本学期课程设置五.打印课程表六.打印教师代课表2.22.2 系统流程和操作方式设计系统流程和操作方式设计系统登陆主界面教职员工入库信息排课管理教职员工带课查询本学

8、期课程安排打印课程表打印教师带课表第三章第三章 系统界面设计系统界面设计3.13.1 系统界面设计系统界面设计1.1.登陆界面登陆界面代码分析代码分析:Option ExplicitPublic LoginSucceeded As BooleanPrivate Sub cmdCancel_Click() set the global var to false to denote a failed login LoginSucceeded = False Unload fmStartEnd SubPrivate Sub cmdOK_Click() check for correct passwo

9、rd If txtPassword = password Then place code to here to pass the success to the calling sub setting a global var is the easiest LoginSucceeded = True Me.Hide fmStart.Show Else MsgBox Invalid Password, try again!, , Login txtPassword.SetFocus SendKeys Home+End End IfEnd SubPrivate Sub Form_Load() Loa

10、d fmStart fmStart.HideEnd Sub2. 教职员入库信息界面教职员入库信息界面:代码分析代码分析:Dim con As ADODB.ConnectionDim rs As ADODB.RecordsetDim qrs As ADODB.RecordsetDim slSql As StringDim i, j As IntegerDim strBak(2) As StringDim sqlStr As StringPrivate Sub Command1_Click(Index As Integer)On Error GoTo Err:Dim cn As IntegerFo

11、r cn = 0 To 2 Text1(cn).Text = Next cnIf rs.RecordCount 0 Then Select Case Index Case 0: rs.MoveFirst Case 1: rs.MovePrevious Command1(2).Enabled = True Command1(3).Enabled = True Case 2: rs.MoveNext Command1(0).Enabled = True Command1(1).Enabled = True Case 3: rs.MoveLast End Select displayInfoEnd

12、IfGoTo ok:Err:Call dataOverok:End SubPrivate Sub dataOver()If rs.BOF Then Command1(0).Enabled = False Command1(1).Enabled = False Command1(2).Enabled = True Command1(3).Enabled = True rs.MoveFirst Else If rs.EOF Then rs.MoveLast Command1(0).Enabled = True Command1(1).Enabled = True Command1(2).Enabl

13、ed = False Command1(3).Enabled = False Else MsgBox Database Error, vbExclamation + vbOKOnly, Error unknown End IfEnd IfEnd SubPrivate Sub Command2_Click(Index As Integer)On Error GoTo errDealIf Index = 0 Or Index = 2 Then CanSave (True)Else CanSave (False)End IfSelect Case IndexCase 0: rs.AddNew Cal

14、l toNull Case 1: j = MsgBox(你确定要删除本记录吗?, vbYesNo + vbQuestion, 删除) If j = vbYes Then rs.Delete Call toNull End If Case 2:rs.Deleters.AddNewCase 3: If Len(LTrim$(RTrim$(Text1(0).Text) 0 Then rs.AddNew For i = 0 To 2 If Len(LTrim$(RTrim$(Text1(i).Text) 0 Then rs.Fields(i) = Text1(i).Text End If Next i

15、 rs.Update Else MsgBox 姓名不得为空, vbOKOnly + vbExclamation, Error End IfCase 4: For i = 0 To 2 Text1(i).Text = strBak(i) Next i Call Command2_Click(3) End SelectExit SuberrDeal:MsgBox database Error, vbExclamation + vbOKOnly, errorokEnd:End SubPrivate Sub CanSave(ok As Boolean)Frame1.Enabled = Not okFr

16、ame3.Enabled = ok For i = 0 To 4 If i 0 Then rs.MoveFirst displayInfo CanSave (False) Else new data CanSave (True) Call Command2_Click(0) End IfEnd SubPrivate Sub displayInfo() i = j = 0 For i = 0 To 2 Text1(i).Text = If Len(rs.Fields(i) 0 Then Text1(i).Text = rs.Fields(i) strBak(i) = Text1(i).Text

17、End If Next i End SubPrivate Sub toNull() For i = 0 To 2 Text1(i).Text = strBak(i) = Next i End SubPrivate Sub Form_Unload(Cancel As Integer)On Error GoTo KKrs.CloseSet rs = Nothingqrs.CloseSet qrs = notingcon.CloseSet con = NothingKK:End SubPrivate Sub queryComm_Click() slSql = select * from Teache

18、r where cTrname = + Text1(3).Text + qrs.Open slSql, con, adOpenStatic If Not qrs.EOF Then qrs.MoveFirst i = j = 0 For i = 0 To 2 Text1(i).Text = If Len(qrs.Fields(i) 0 Then Text1(i).Text = qrs.Fields(i) strBak(i) = Text1(i).Text End If Next i End If qrs.CloseEnd Sub3. 排课管理界面排课管理界面代码分析代码分析:Option Exp

19、licitDim conn As ADODB.ConnectionDim rsTr As ADODB.RecordsetDim rsSj As ADODB.RecordsetDim i, j, sjCnt As IntegerDim ClassCode As StringDim TrChanged, ClassChanged As BooleanDim strSql As StringDim rsTrAry As ADODB.RecordsetDim rsClassAry As ADODB.RecordsetDim StrTr(9) As StringDim strSj(49) As Stri

20、ngDim minht, maxHt As IntegerPrivate Sub EnableSave(ok As Boolean)Dim k As IntegerFor k = 0 To 3 If k 0 And Len(ClassCode) 1 Then Call displayInfo cb(1).Enabled = True End IfCase 1: cb_Click (0) EnableSave (True) cb(1).Enabled = False Case 2: If TrChanged Then strSql = delete * from trclass where cc

21、lasscode= & ClassCode & conn.Execute strSql Dim strTrName As String For i = 0 To sjCnt - 1 strTrName = Trim(Combo2(i).Text) If Len(strTrName) 0 Then strSql = insert into trclass values( & ClassCode & , + + Trim(Label2(i).Caption) + , + + Trim(Combo2(i).Text) + ) me.caption = strSql c

22、onn.Execute strSql End If Next i TrChanged = False rsTrAry.Requery cb(1).Enabled = False End If If ClassChanged Then conn.Execute delete * from classarray where cclasscode= & ClassCode & Dim X, Y As Integer For i = 0 To 49 Y = i Mod 5 + 1 X = Int(i / 5) + 1 If Len(Trim(Combo3(i).Text) 0 Then

23、 strSql = insert into classarray values( & ClassCode & , & Y & , & X & , & Trim(Combo3(i).Text) & ) me.caption = strSql conn.Execute strSql End If Next i ClassChanged = False rsClassAry.Requery End If EnableSave (False) Case 3: For i = 0 To sjCnt - 1 Combo2(i).Text =

24、Combo2(i).Tag Next i For i = 0 To 49 Combo3(i).Text = Combo3(i).Tag Next i EnableSave (False) cb(1).Enabled = False End Select GoTo okerrDeal:MsgBox Error Unknownok:Me.MousePointer = 0End SubPrivate Sub displayInfo()For j = 0 To sjCnt - 1 strSql = select cteacher from trclass where cclasscode= &

25、 ClassCode & and csubject= & Trim(Label2(j).Caption) & Text1.Text = strSql me.caption = strSql Set rsTrAry = conn.Execute(strSql) Dim tpRs As ADODB.Recordset Set tpRs = conn.Execute(select cteacher from trclass where cclasscode= & ClassCode & and csubject= & Trim(Label2(j).Ca

26、ption) & ) Text1.Text = # & strSql & # While Not tpRs.EOF Text1.Text = Text1.Text + tpRs.Fields(0) tpRs.MoveNext Wend 这里用另一种方法创建 recordset rsTrAry. If Not rsTrAry.EOF Then rsTrAry.MoveFirst Combo2(j).Text = rsTrAry.Fields(0) rsTrAry!cteacher Combo2(j).Tag = rsTrAry.Fields(0) rsTrAry!ctea

27、cher EnableSave (False) Else MsgBox nodata, vbOKOnly Combo2(j).Text = Combo2(j).Tag = EnableSave (True) 这里语句可能出错 End IfNext jFor i = 0 To 49 Dim X, Y As Integer X = Int(i / 5 + 1) Y = i Mod 5 + 1 strSql = select csjname from classarray where cclasscode= & ClassCode & and itimew= & Y &

28、; and itimen= & X me.caption = strSql rsClassAry.Open strSql, conn, adOpenStatic, adLockOptimistic Set rsClassAry = conn.Execute(strSql) If Not rsClassAry.EOF Then Combo3(i).Text = rsClassAry.Fields(0) Combo3(i).Tag = rsClassAry.Fields(0) EnableSave (False) Else Combo3(i).Text = Combo3(i).Tag =

29、EnableSave (True) End IfNext i End SubPrivate Function Trim(str As String) As StringTrim = LTrim$(RTrim$(str)End FunctionPrivate Sub Combo2_Change(Index As Integer)TrChanged = TrueEnd SubPrivate Sub Combo3_Change(Index As Integer) ClassChanged = True End SubPrivate Sub Command1_Click()Timer1.Enabled

30、 = TrueEnd SubPrivate Sub Form_Load()Me.MousePointer = 11Set conn = New ADODB.ConnectionSet rsTr = New ADODB.RecordsetSet rsSj = New ADODB.RecordsetSet rsTrAry = New ADODB.RecordsetSet rsClassAry = New ADODB.RecordsetProvider=Microsoft.Jet.OLEDB.3.51;Persist Security Info=False;Data Source=C:WINDOWS

31、DesktopdataUse.mdbconn.Open provider=Microsoft.Jet.OLEDB.4.0; data source= & App.Path & dataUse.mdbrsTr.Open select * from teacher, conn, adOpenStatic, adLockOptimisticrsSj.Open select * from subject, conn, adOpenStatic, adLockOptimisticminht = 4090maxHt = 9000sjCnt = rsSj.RecordCountCall co

32、mboInitEnableSave (False)cb(1).Enabled = FalseCommand1.Tag = Me.Height = minhtMe.MousePointer = 0End SubPrivate Sub comboInit()rsSj.MoveFirstDim trCnt As IntegertrCnt = rsTr.RecordCountrsTr.MoveFirstCombo1(0).Text = Combo1(1).Text = For i = 1 To 12 Combo1(0).AddItem (i) Next iFor i = 1 To 20 Combo1(

33、1).AddItem (i)Next iFor i = 0 To 9 Combo2(i).Text = If i 0 Then For j = 0 To trCnt - 1 the last modified here. Combo2(i).List(j) = Combo2(0).List(j) Next j Else rsTr.MoveFirst While Not rsTr.EOF Combo2(i).AddItem (rsTr.Fields(0) rsTr.MoveNext Wend End IfNext iFor i = 0 To 49 Combo3(i).Text = For j =

34、 0 To sjCnt - 1 Combo3(i).AddItem (Label2(j).Caption) Next jNext i End SubPrivate Sub Form_Resize() Frame3.Top = Me.Height - Frame3.Height - 520 End SubPrivate Sub Form_Unload(Cancel As Integer)On Error GoTo Err:rsTr.ClosersSj.ClosersTrAry.ClosersClassAry.CloseSet rsTr = NothingSet rsSj = NothingSet

35、 rsTrAry = NothingSet rsClassAry = Nothingconn.CloseSet conn = NothingErr:End SubPrivate Sub Timer1_Timer()If Command1.Caption = Then If Me.Height maxHt Then Me.Height = Me.Height + 150 Else Timer1.Enabled = False Command1.Caption = minht Then Me.Height = Me.Height - 150 Else Timer1.Enabled = False

36、Command1.Caption = Command1.ToolTipText = 课程表在这里! Me.Height = minht Timer2.Enabled = True End IfEnd If End SubPrivate Sub Timer2_Timer()Static r, g, b As Integerr = 100g = 50b = 20Command1.BackColor = RGB(r, g, b)Shape2.BackColor = RGB(255 - r, 255 - g, 255 - b)r = r + 15g = g + 39b = b + 87If r 255

37、 Then r = 0End IfIf g 255 Then g = 0End IfIf b 255 Then b = 0End If End Sub4. 教职员带课查询教职员带课查询界面设计界面设计:代码分析代码分析:Option ExplicitDim conn As ADODB.ConnectionDim rs As ADODB.RecordsetDim rsTr As ADODB.RecordsetDim i, j, value, idx As IntegerDim strName, strSql As StringPrivate Type DataGetclass As String

38、Sjname As StringTw As IntegerTn As IntegerEnd TypePrivate Sub Command1_Click()On Error GoTo bnEndMe.MousePointer = 11Dim sSql As StringDim dgUse As DataGetSelect Case IndexCase 0: Call ClearCombo strName = LTrim$(RTrim$(Combo1.Text) If Len(strName) 0 Then sSql = strSql & & strName & Set

39、rs = conn.Execute(sSql) If Not rs.EOF Then While Not rs.EOF dgUse.class = rs.Fields(0) dgUse.Sjname = rs.Fields(1) dgUse.Tw = rs.Fields(2) dgUse.Tn = rs.Fields(3) idx = (dgUse.Tn - 1) * 5 + dgUse.Tw - 1 Combo3(idx).Visible = True Combo3(idx).AddItem (dgUse.class & 班) Combo3(idx).AddItem (dgUse.S

40、jname) Combo3(idx).Text = Combo3(idx).List(value) rs.MoveNext Wend Else MsgBox 没有得到相关数据,请检查, vbOKOnly + vbInformation, 数据捕捉 End If Dim lcnt As Integer For lcnt = 0 To 49 If Combo3(lcnt).ListCount 2 Then Combo3(lcnt).BackColor = RGB(200, 255, 255) Combo3(lcnt).AddItem (注意有重课) End If Next lcnt Else Ms

41、gBox 请输入或选择一教职员姓名, vbInformation + vbOKOnly, 查询输入 End If End SelectbnEnd:Me.MousePointer = 0 End SubPrivate Sub ClearCombo()For i = 0 To 49 Combo3(i).BackColor = RGB(255, 255, 255) Combo3(i).Text = Combo3(i).Visible = False Combo3(i).Clear Next iEnd SubPrivate Sub Form_Load()Me.MousePointer = 11On E

42、rror GoTo KKaSet conn = New ADODB.Connectionconn.Open provider=Microsoft.Jet.OLEDB.4.0; data source= & App.Path & dataUse.mdbSet rsTr = conn.Execute(select ctrname from teacher)For i = 0 To 9 Label3(i).Caption = i + 1Next iWhile Not rsTr.EOF Combo1.AddItem (rsTr.Fields(0) rsTr.MoveNext WendC

43、all ClearCombostrSql = select trclass.cclasscode,trclass.csubject,classarray.itimew,classarray.itimen + _ from teacher,trclass,classarray + _where teacher.ctrname=trclass.cteacher and trclass.cclasscode=classarray.cclasscode + _ and trclass.csubject=classarray.csjname and teacher.ctrname=select trcl

44、ass.cclasscode,trclass.csubject,classarray.itimew,classarray.itimenFrom teacher, trclass, classarrayWhere teacher.ctrname = trclass.cteacher And trclass.cclasscode = classarray.cclasscodeand trclass.csubject=classarray.csjnameand teacher.ctrname=陈strSql = select teacher.ctrname,trclass.cclasscode,cl

45、assarray.itimew,classarray.itimen + _ from teacher join trclass on teacher.ctrname=trclass.cteacher join classarray + _ on trclass.cclasscode=classarray.classcode where teacher.ctrname=value = 0GoTo okKKa:MsgBox Error Unknownok:Me.MousePointer = 0End SubPrivate Sub Form_Unload(Cancel As Integer)On E

46、rror GoTo KK:rs.ClosersTr.CloseSet rs = NothingSet rsTr = Nothingconn.CloseSet conn = NothingKK:End SubPrivate Sub Opn_Click(Index As Integer)value = IndexCall Command1_ClickEnd Sub5. 本学期课程设置本学期课程设置界面设计界面设计:代码分析代码分析:Option ExplicitDim con As ADODB.ConnectionDim rs As ADODB.RecordsetDim str(9) As Str

47、ingDim strSql As StringPrivate Sub cn_Click(Index As Integer)On Error GoTo ex:Dim lcnt As IntegerDim strTxt As StringSelect Case IndexCase 0: CanSave (True) Case 1: con.Execute (delete * from subject) For lcnt = 0 To 9 strTxt = Trim$(LTrim$(Txt(lcnt).Text) If Len(strTxt) 0 Then rs.AddNew rs!csjname

48、= strTxt rs.Update End If Next lcnt CanSave (False)Case 2: For lcnt = 0 To 9 Txt(lcnt) = str(lcnt) Next lcnt CanSave (False) End Select Exit Subex:MsgBox database error, vbOKOnly + vbExclamation, errorEnd SubPrivate Sub Form_Load()strSql = insert into subject values( Set con = New ADODB.ConnectionSe

49、t rs = New ADODB.RecordsetCall clearTxtCanSave (False)con.Open provider=Microsoft.Jet.OLEDB.4.0; data source= & App.Path & dataUse.mdbrs.Open select * from subject, con, adOpenStatic, adLockOptimisticCall displayInfoEnd SubPrivate Sub CanSave(bSave As Boolean)Frame1.Enabled = bSavecn(1).Enab

50、led = bSavecn(2).Enabled = bSavecn(0).Enabled = Not bSaveEnd SubPrivate Sub displayInfo()rs.MoveFirstDim lcnt As Integerlcnt = 0While (Not rs.EOF And lcnt 10) Txt(lcnt).Text = rs!csjname str(lcnt) = Txt(lcnt).Text lcnt = lcnt + 1 rs.MoveNext WendEnd SubPrivate Sub clearTxt()Dim lcnt As IntegerFor lc

51、nt = 0 To 9 Txt(lcnt).Text = Next lcntEnd SubPrivate Sub Form_Unload(Cancel As Integer)rs.Closecon.CloseSet rs = NothingSet con = NothingEnd Sub6. 打印课程表打印课程表界面设计界面设计:代码设计代码设计:临时课表Dim ctCon As ADODB.ConnectionDim ctrs As ADODB.RecordsetclassArray 表Dim cacon As ADODB.ConnectionDim cars As ADODB.Record

52、setDim sqlStr As StringDim ClassCode As StringDim wStr(5) As StringPrivate Sub clearStr() For i = 1 To 5 wStr(i) = Next iEnd SubPrivate Sub Update_ct() 删除所有以前的记录 ctCon.Execute (delete * from tempCT) 更新表 sqlStr = select * from classArray where cclasscode= & ClassCode & & order by iTimeN c

53、acon.Execute sqlStr cars.Open sqlStr, cacon, adOpenStatic, adLockOptimistic cars.MoveFirst Dim i As Integer i = 1 clearStr While (Not cars.EOF) While cars!iTimeN i 添加一条课程记录 strSql = insert into tempCT values( & i & , + + wStr(1) + , + + wStr(2) + , + + wStr(3) + , + + wStr(4) + , + + wStr(5)

54、 + ) ctCon.Execute strSql clearStr i = i + 1 Wend wStr(cars!iTimeW) = cars!csjname cars.MoveNext Wend 添加一条课程记录 strSql = insert into tempCT values( & i & , + + wStr(1) + , + + wStr(2) + , + + wStr(3) + , + + wStr(4) + , + + wStr(5) + ) ctCon.Execute strSql clearStr While i 10 添加一条课程记录 strSql

55、= insert into tempCT values( & i & , + + wStr(1) + , + + wStr(2) + , + + wStr(3) + , + + wStr(4) + , + + wStr(5) + ) ctCon.Execute strSql i = i + 1 WendEnd SubPrivate Sub Command1_Click() ClassCode = Trim(gradeCombox.Text) & . & Trim(classCombox.Text) Call Update_ct Unload Me classRe

56、p.ShowEnd SubPrivate Sub Form_Load() For i = 1 To 12 gradeCombox.AddItem (i) Next i For i = 1 To 20 classCombox.AddItem (i) Next i Set cacon = New ADODB.Connection Set cars = New ADODB.Recordset cacon.Open provider=Microsoft.Jet.OLEDB.4.0; data source= & App.Path & dataUse.mdb Set ctCon = Ne

57、w ADODB.Connection Set ctrs = New ADODB.Recordset ctCon.Open provider=Microsoft.Jet.OLEDB.4.0; data source= & App.Path & dataUse.mdbEnd SubPrivate Sub Form_Unload(Cancel As Integer) cars.Close cacon.Close Set cars = Nothing Set cacon = Nothing ctCon.Close Set ctrs = Nothing Set ctCon = Nothi

58、ngEnd Sub7. 打印教师代课表打印教师代课表界面设计界面设计:代码设计代码设计:临时教师代课表Dim ttCon As ADODB.ConnectionDim ttrs As ADODB.RecordsettrClass 表Dim trcon As ADODB.ConnectionDim trrs As ADODB.RecordsetDim sqlStr As StringDim trname As StringDim wStr(5) As StringDim clStr(5) As StringPrivate Sub clearStr() For i = 1 To 5 wStr(i)

59、 = clStr(i) = Next iEnd SubPrivate Sub Update_tt() ttCon.Execute delete * from tempTT strSql = select trclass.cclasscode,trclass.csubject,classarray.itimew,classarray.itimen + _ from teacher,trclass,classarray + _where teacher.ctrname=trclass.cteacher and trclass.cclasscode=classarray.cclasscode + _

60、 and trclass.csubject=classarray.csjname and teacher.ctrname= + + trname + _+ order by iTimeN trcon.Execute strSql trrs.Open strSql, trcon, adOpenStatic, adLockOptimistic trrs.MoveFirst Dim i As Integer i = 1 clearStr While Not trrs.EOF While trrs!iTimeN i strSql = insert into tempTT values( & i & , + + wStr(1) + , + + wStr(2) + , + + wStr(3) + , + + wStr(4) + , + + wStr(5) + _ , + clStr(1) + , + + clStr(2) + , + + clStr(3) + , + + clStr(4) + , + + clStr(5) + ) ttCon.Execute strSql clearStr i = i + 1 Wend wStr(trrs!iT

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论