VB學(xué)生成績管理系統(tǒng)的設(shè)計(jì)與實(shí)現(xiàn)課程設(shè)計(jì)報(bào)告_第1頁
VB學(xué)生成績管理系統(tǒng)的設(shè)計(jì)與實(shí)現(xiàn)課程設(shè)計(jì)報(bào)告_第2頁
VB學(xué)生成績管理系統(tǒng)的設(shè)計(jì)與實(shí)現(xiàn)課程設(shè)計(jì)報(bào)告_第3頁
VB學(xué)生成績管理系統(tǒng)的設(shè)計(jì)與實(shí)現(xiàn)課程設(shè)計(jì)報(bào)告_第4頁
VB學(xué)生成績管理系統(tǒng)的設(shè)計(jì)與實(shí)現(xiàn)課程設(shè)計(jì)報(bào)告_第5頁
已閱讀5頁,還剩23頁未讀 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡介

1、 vb程序設(shè)計(jì)課程設(shè)計(jì)報(bào)告 班 級:資工10902 班 目 錄1、課設(shè)的目的32、界面設(shè)計(jì)和功能設(shè)計(jì)33、系統(tǒng)功能實(shí)施124、系統(tǒng)功能設(shè)計(jì)195、總結(jié)和體會28一、課設(shè)的目的 1.通過本次課程設(shè)計(jì),提高實(shí)踐動手能力;2.通過本次課程設(shè)計(jì),進(jìn)一步理解計(jì)算機(jī)程序設(shè)計(jì)的思路與方法;3.通過本次課程設(shè)計(jì),進(jìn)一步熟練運(yùn)用vb的語言元素和流程控制語句;4.通過本次課程設(shè)計(jì),達(dá)到能熟練使用各種常見的vb控件,理解面向?qū)ο蟮乃枷耄?.通過本次課程設(shè)計(jì),熟悉用戶界面的設(shè)計(jì);6.通過本次課程設(shè)計(jì),熟悉數(shù)據(jù)訪問控件ado及相關(guān)對象的使用,能基于ado控件實(shí)現(xiàn)access的數(shù)據(jù)訪問與操縱; 二、界面設(shè)計(jì)和功能設(shè)計(jì) 1

2、、下面的界面為用戶登陸界面: 用戶名和密碼均已設(shè)定,用戶名為zg,密碼為10902,只有輸入正確,然后點(diǎn)擊“登陸“按鈕才能進(jìn)入主界面。如果用戶名或密碼三次輸入錯誤,則系統(tǒng)自動退出。 當(dāng)你點(diǎn)擊“退出“按鈕時(shí),彈出一個(gè)對話窗,界面如下:在對話框上點(diǎn)擊“是”按鈕,則退出系統(tǒng),如果點(diǎn)擊“否”,則該界面不變。2、當(dāng)用戶名和密碼均輸入正確,點(diǎn)擊“登陸”按鈕,進(jìn)入主界面“學(xué)生成績管理系統(tǒng)”界面,該界面是其他子界面的入口,界面如下:3、進(jìn)入主界面后,點(diǎn)擊“學(xué)生管理(刪除添加)”,進(jìn)入學(xué)生管理界面,界面如下:該界面上有一個(gè)ado控件,用于連接數(shù)據(jù)庫,當(dāng)用戶在六個(gè)文本框中輸入數(shù)據(jù)時(shí),點(diǎn)擊“添加“按鈕,可以將數(shù)據(jù)錄

3、入到數(shù)據(jù)庫中,如果此時(shí)點(diǎn)擊”刪除“按鈕,則剛才輸入的數(shù)據(jù)就會被刪除,點(diǎn)擊”保存“按鈕時(shí),輸入的數(shù)據(jù)就會自動保存在數(shù)據(jù)庫里,點(diǎn)擊”返回主窗體“按鈕,該窗體消失,主窗體出現(xiàn)。4、在主界面點(diǎn)擊“各科成績查詢“按鈕,出現(xiàn)如下界面:該界面有一個(gè)ado控件,用來連接數(shù)據(jù)庫,還有一個(gè)datagrid控件,用來顯示學(xué)生成績的查詢結(jié)果,當(dāng)用戶選擇了要查詢的科目和條件后,點(diǎn)擊“查詢“按鈕,在datagrid控件上就會顯示出所查詢的結(jié)果。下面為輸入條件后查詢的結(jié)果5、在主界面點(diǎn)擊“姓名查詢“按鈕后,會出現(xiàn)如下界面:該界面與上一界面相似,在文本框輸入要查詢的姓名后,點(diǎn)擊“查詢“按鈕,就會在datagrid控件上顯示所

4、要查詢的結(jié)果。下面為輸入條件后查詢的結(jié)果5、在主界面點(diǎn)擊“班級查詢“按鈕后,會出現(xiàn)如下界面:在文版框中輸入所要查詢的班級,datagrid控件上就會顯示所要查詢的結(jié)果。下面為輸入條件后查詢的結(jié)果6、在主界面上點(diǎn)擊“各科成績段查詢“按鈕后,會出現(xiàn)如下界面:點(diǎn)擊“計(jì)算分?jǐn)?shù)段統(tǒng)計(jì)“按鈕后,就會出現(xiàn)所要查詢的結(jié)果。下面為查詢的結(jié)果7、在主界面點(diǎn)擊“排名“按鈕后,出現(xiàn)如下界面:在該界面上點(diǎn)擊“排名“按鈕后,在datagrid控件上會顯示出按成績高低排名的結(jié)果,點(diǎn)擊”清除排名“按鈕后,剛才結(jié)果消失,顯示原來結(jié)果。下面為所現(xiàn)實(shí)的結(jié)果8、在主界面點(diǎn)擊“統(tǒng)計(jì)直方圖“按鈕后,出現(xiàn)如下界面:在該界面點(diǎn)擊各個(gè)按鈕后,

5、就會出現(xiàn)與之相關(guān)科目的成績統(tǒng)計(jì)直方圖,下面為查詢的結(jié)果 9、在主界面點(diǎn)擊“優(yōu)等生“按鈕后,出現(xiàn)如下界面:點(diǎn)擊按鈕查詢后,結(jié)果就會在界面上顯示出來。下面為所查詢的結(jié)果三、系統(tǒng)功能實(shí)施 以上展示的是系統(tǒng)的所有界面,怎樣才能讓這所有的功能實(shí)現(xiàn)呢?數(shù)據(jù)庫和ado控件的使用便是其中的關(guān)鍵。 1、建立如下數(shù)據(jù)庫(學(xué)號、姓名、班級、英語、數(shù)學(xué)、vb、總分、排名)2、建立如下圖的所有界面: 3、ado控件和datagrid控件以及數(shù)據(jù)庫的連接步驟:(這一步在設(shè)計(jì)界面的同時(shí)完成)(1)、如何加載ado控件:步驟1:步驟2:步驟3:各個(gè)界面的ado控件如何連接數(shù)據(jù)庫(分兩步):步驟1: 如下面界面中的5個(gè)步驟步驟

6、2:選中ado控件adodc1,點(diǎn)擊鼠標(biāo)右鍵選擇屬性,然后界面設(shè)置如下:控件綁定數(shù)據(jù)庫的字段操作說明:屬性設(shè)置說明:下面以學(xué)號為例,姓名、班級等都可參考此。將學(xué)號對應(yīng)的文本框text1連接adodc1顯示數(shù)據(jù)庫中的學(xué)號,需要設(shè)置datasource和datafield兩個(gè)屬性,首先選中text1文本框,并進(jìn)行下面的兩步操作,即可綁定數(shù)據(jù)庫的學(xué)號字段。設(shè)置datasource:設(shè)置datafield:(2)、如何加載datagrid控件控件datagrid,可以實(shí)現(xiàn)數(shù)據(jù)的批量處理,該控件在控件庫microsoft datagrid control 6.0中。說明:datagrid控件屬性設(shè)置四、

7、系統(tǒng)功能設(shè)計(jì)系統(tǒng)功能的設(shè)計(jì),其核心就是程序代碼的編寫過程,如何讓讓系統(tǒng)更加完善、界面更加友好呢,這就得益于代碼的編寫。以下為各個(gè)界面所對應(yīng)的代碼該界面代碼如下:private sub command1_click() if text1.text = "zg" and text2.text = "10902" then mainfrm.show dlfrm.hide else msgbox "用戶名或密碼錯誤,請重新輸入", vbmsgboxsetforeground, "系統(tǒng)提示!" end if static t

8、 as integer t = t + 1 if t >= 3 then endend subprivate sub command2_click()a = msgbox("確定要退出本系統(tǒng)嗎?", 3 + 32 + 256, "系統(tǒng)提示!")if a = 6 thenunload meend ifend sub 該界面代碼如下: private sub command1_click() xsglfrm.showend subprivate sub command10_click() ydsfrm.showend subprivate sub co

9、mmand3_click() jszffrm.showend subprivate sub command4_click() pmfrm.showend subprivate sub command5_click() zftjtfrm.showend subprivate sub command6_click() cjcxfrm.showend subprivate sub command7_click() xmcxfrm.showend subprivate sub command8_click() bjcxfrm.showend subprivate sub command9_click(

10、) gkcjfrm.showend sub該界面代碼如下:private sub command1_click() me.adodc1.recordset.addnewend subprivate sub command2_click() if me.adodc1.recordset.recordcount = 0 or me.adodc1.recordset.eof then exit subend ifme.adodc1.recordset.deleteme.adodc1.recordset.movenextif me.adodc1.recordset.recordcount = 0 th

11、en exit subend ifif me.adodc1.recordset.eof then me.adodc1.recordset.movelastend subprivate sub command4_click() me.adodc1.recordset.saveend subprivate sub command5_click() unload me mainfrm.showend sub該界面代碼如下:dim kc_條件 as stringdim kc as stringprivate sub command1_click()kc_條件 = me.text1me.adodc1.r

12、ecordsource = "select * from stu where " + kc + " " + kc_條件me.adodc1.refreshend subprivate sub form_load()kc_條件 = ">=92"kc = "vb"end subprivate sub option1_click()kc = "vb"end subprivate sub option2_click()kc = "math"end subprivate sub o

13、ption3_click()kc = "english"end sub該界面代碼如下:dim kc_條件 as stringdim kc as stringprivate sub command1_click()kc_條件 = me.text1me.adodc1.recordsource = "select * from stu where " + kc + "='" + kc_條件 + "'"me.adodc1.refreshend subprivate sub form_load()kc = &

14、quot;name"end sub該界面代碼如下:dim kc_條件 as stringdim kc as stringprivate sub command1_click()kc_條件 = me.text1me.adodc1.recordsource = "select * from stu where " + kc + "='" + kc_條件 + "'"me.adodc1.refreshend subprivate sub form_load()kc = "class"end sub

15、該界面代碼如下:private sub command1_click() dim vb_a as integer dim vb_b as integer dim vb_c as integer dim vb_d as integer dim vb_e as integer dim math_a as integer dim math_b as integer dim math_c as integer dim math_d as integer dim math_e as integer dim english_a as integer dim english_b as integer dim

16、 english_c as integer dim english_d as integer dim english_e as integer me.adodc1.recordsource = "select * from stu where vb>=90" me.adodc1.refresh vb_a = me.adodc1.recordset.recordcount me.text1 = vb_a me.adodc1.recordsource = "select * from stu where vb>=80 and vb<90"

17、me.adodc1.refresh vb_b = me.adodc1.recordset.recordcount me.text2 = vb_b me.adodc1.recordsource = "select * from stu where vb>=70 and vb<80" me.adodc1.refresh vb_c = me.adodc1.recordset.recordcount me.text3 = vb_c me.adodc1.recordsource = "select * from stu where vb>=60"

18、 me.adodc1.refresh vb_d = me.adodc1.recordset.recordcount me.text4 = vb_d me.adodc1.recordsource = "select * from stu where vb<60" me.adodc1.refresh vb_b = me.adodc1.recordset.recordcount me.text5 = vb_e me.adodc1.recordsource = "select * from stu where math>=90" me.adodc1.

19、refresh math_a = me.adodc1.recordset.recordcount me.text6 = math_a me.adodc1.recordsource = "select * from stu where math>=80 and math<90" me.adodc1.refresh math_b = me.adodc1.recordset.recordcount me.text7 = math_b me.adodc1.recordsource = "select * from stu where math>=70 a

20、nd math<80" me.adodc1.refresh math_c = me.adodc1.recordset.recordcount me.text8 = math_c me.adodc1.recordsource = "select * from stu where math>=60 " me.adodc1.refresh math_d = me.adodc1.recordset.recordcount me.text9 = math_d me.adodc1.recordsource = "select * from stu whe

21、re math<60" me.adodc1.refresh math_e = me.adodc1.recordset.recordcount me.text10 = math_e me.adodc1.recordsource = "select * from stu where english>=90" me.adodc1.refresh english_a = me.adodc1.recordset.recordcount me.text11 = english_a me.adodc1.recordsource = "select * fr

22、om stu where english>=80 and english<90" me.adodc1.refresh english_b = me.adodc1.recordset.recordcount me.text12 = english_b me.adodc1.recordsource = "select * from stu where english>=70 and english<80" me.adodc1.refresh english_c = me.adodc1.recordset.recordcount me.text1

23、3 = english_c me.adodc1.recordsource = "select * from stu where english>=60" me.adodc1.refresh english_d = me.adodc1.recordset.recordcount me.text14 = english_d me.adodc1.recordsource = "select * from stu where english<60" me.adodc1.refresh english_e = me.adodc1.recordset.r

24、ecordcount me.text15 = english_eend subprivate sub form_load() text1.text = "" text2.text = "" text3.text = "" text4.text = "" text5.text = "" text6.text = "" text7.text = "" text8.text = "" text10.text = "" te

25、xt11.text = "" text12.text = "" text13.text = "" text14.text = "" text15.text = ""end sub該界面代碼如下:private sub command1_click()me.adodc1.recordsource = "select * from stu order by total desc"me.adodc1.refreshme.adodc1.recordset.movefirstfor i

26、 = 1 to me.adodc1.recordset.recordcount me.adodc1.recordset.fields("mc").value = i me.adodc1.recordset.update me.adodc1.recordset.movenextnext iend subprivate sub command2_click()me.adodc1.recordset.movefirstfor i = 1 to me.adodc1.recordset.recordcount me.adodc1.recordset.fields("mc&q

27、uot;).value = null me.adodc1.recordset.update me.adodc1.recordset.movenextnext iend sub該界面代碼如下:private sub command1_click() me.adodc1.refresh '填充表格數(shù)據(jù) mschart1.rowcount = 1 mschart1.columncount = me.adodc1.recordset.recordcount me.adodc1.recordset.movefirst for lngi = 1 to me.adodc1.recordset.rec

28、ordcount mschart1.column = lngi '用data屬性向mschart數(shù)據(jù)網(wǎng)格填充數(shù)據(jù) mschart1.data = val(adodc1.recordset.fields("vb").value) mschart1.columnlabel = adodc1.recordset.fields("name").value adodc1.recordset.movenext next lngi mschart1.rowlabel = "vb成績直方圖"end subprivate sub command

29、2_click() me.adodc1.refresh '填充表格數(shù)據(jù) mschart1.rowcount = 1 mschart1.columncount = me.adodc1.recordset.recordcount me.adodc1.recordset.movefirst for lngi = 1 to me.adodc1.recordset.recordcount mschart1.column = lngi '用data屬性向mschart數(shù)據(jù)網(wǎng)格填充數(shù)據(jù) mschart1.data = val(adodc1.recordset.fields("mat

30、h").value) mschart1.columnlabel = adodc1.recordset.fields("name").value adodc1.recordset.movenext next lngi mschart1.rowlabel = "math成績直方圖"end sub該界面代碼如下private sub command1_click() dim vb as integer dim math as integerdim english as integer me.adodc1.recordsource = "se

31、lect * from stu where (math+english+vb)/3>=90) or(math+english+vb)/3>=85 and (math=100 or english=100 or vb=100 )or(vb+english+math)/3>=85 and (vb>=95 and english >=95)or (english>=95 and math>=95)or ( math>=95 and vb>=95 )and (mc<=3) and (vb>=60 and english>=60 and math>=60)" me.adodc1.refreshend sub五、總結(jié)和

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

最新文檔

評論

0/150

提交評論