學(xué)生信息管理系統(tǒng)畢業(yè)設(shè)計論文_第1頁
學(xué)生信息管理系統(tǒng)畢業(yè)設(shè)計論文_第2頁
學(xué)生信息管理系統(tǒng)畢業(yè)設(shè)計論文_第3頁
學(xué)生信息管理系統(tǒng)畢業(yè)設(shè)計論文_第4頁
學(xué)生信息管理系統(tǒng)畢業(yè)設(shè)計論文_第5頁
已閱讀5頁,還剩34頁未讀, 繼續(xù)免費閱讀

下載本文檔

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

文檔簡介

1、.湖北輕工職業(yè)技術(shù)學(xué)院畢業(yè)設(shè)計(論文)題目: 學(xué)生信息管理系統(tǒng)畢業(yè)論文系 部: 信息工程系專業(yè): 軟件開發(fā)學(xué)生姓名: 李 海學(xué) 號: 20130301112指導(dǎo)教師: 程 寧2016年 5 月 28 日.學(xué)生信息管理系統(tǒng)摘要隨著學(xué)校的規(guī)模不斷擴大,學(xué)生數(shù)量急劇增長,需要管理的各種信息也成倍增加。同時由于計算機和網(wǎng)絡(luò)技術(shù)的普及,建立一個C/S或者B/S結(jié)構(gòu)的學(xué)生信息管理系統(tǒng)之后,學(xué)生可以通過網(wǎng)絡(luò)來選課并管理自己的信息,使得學(xué)生信息管理工作系統(tǒng)化、規(guī)范化高了學(xué)校管理學(xué)生信息的效率。學(xué)生信息管理系統(tǒng)是利用Visual Basic開發(fā)設(shè)計的。數(shù)據(jù)庫是基于SQL SERVER設(shè)計的。學(xué)校管理人員可以通過

2、該系統(tǒng)方便、快速、有效的管理學(xué)生信息。本系統(tǒng)主要實現(xiàn)了對高校從學(xué)生學(xué)籍信息錄入、學(xué)生選課、學(xué)生考核、到學(xué)生成績管理。整個系統(tǒng)分為學(xué)生信息管理、學(xué)生課程信息管理、學(xué)生成績管理、系統(tǒng)管理四大模塊。其中,學(xué)生信息管理模塊包括學(xué)生信息錄入、學(xué)生信息修改。學(xué)生課程信息管理模塊包括學(xué)生選課、學(xué)生課程查詢。學(xué)生成績管理模塊包括學(xué)生成績錄入、學(xué)生成績查詢。系統(tǒng)管理模塊包括用戶權(quán)限、密碼修改、退出系統(tǒng)。整個系統(tǒng)從操作簡便、靈活、實用的目的要求出發(fā)完成學(xué)生信息管理系統(tǒng)全過程。關(guān)鍵字:計算機網(wǎng)絡(luò)、數(shù)據(jù)庫、信息管理、學(xué)生信息管理系統(tǒng) STUDENTS INFORMATION MANAGEMENT SYSTEM ABS

3、TRACTWith the scale enlargement of the school, the number of students has increased dramatically, need to manage all of the information also increase exponentially. At the same time because the computer and popularization of the network technology, build a C/S or B/S structure of students informatio

4、n management system after a student can through the network and management of their course information, the students information management system, the high school students standardized management information efficiency. Students information management system is to use Visual Basic development of th

5、e design. The database is based on SQL SERVER of the design. The school management personnel may through this system, convenient, fast, and the effective management of the students information. This system mainly for college students realize from the student status information recorded, students cou

6、rse selection, students appraisal, to student performance management. The whole system is divided into students information management, students course information management, student performance management, system management four modules. Among them, students information management modules includin

7、g student information recorded, students information changes. Students course information management module includes students course selection, students course inquiry. Students performance management module includes students achievements recorded, students scores query. System management module inc

8、luding user permissions, and password changing, exit system. The whole system from simple operation, flexible, practical purpose finish requirement student information management system process. KEY WORDS: computer networks, database, the information management, the students information management s

9、ystem.目錄1前 言12系統(tǒng)技術(shù)及運行環(huán)境22.1 Visual Basic 6.0簡介22.2系統(tǒng)開發(fā)及運行環(huán)境23 系統(tǒng)分析23.1需求分析23.2可行性分析34系統(tǒng)設(shè)計34.1 設(shè)計目標34.2項目規(guī)劃44.3系統(tǒng)流程圖45系統(tǒng)詳細設(shè)計55.1數(shù)據(jù)庫需求分析55.2數(shù)據(jù)庫邏輯結(jié)構(gòu)設(shè)計66.系統(tǒng)實現(xiàn)76.1系統(tǒng)初始界面86.2附加數(shù)據(jù)庫106.3登陸界面設(shè)計116.4學(xué)生信息錄入146.5 學(xué)生信息修改176.6 學(xué)生信息查詢186.7學(xué)生成績錄入206.8 修改學(xué)生成績226.9學(xué)生成績查詢236.10用戶管理246.11修改用戶密碼276.12關(guān)于系統(tǒng)29結(jié)論29致 謝30參考文獻

10、30.1前 言學(xué)生信息管理系統(tǒng)(Student Information Management System),以下簡稱SIMS,是針對學(xué)校人事處的大量業(yè)務(wù)處理工作而開發(fā)的管理軟件,是典型的管理信息系統(tǒng)(Management Information System)。它是一個教育單位不可缺少的部分,它的內(nèi)容對于學(xué)校的決策者和管理者來說都至關(guān)重要,它能夠為用戶提供充足的信息和快捷的查詢手段。能有效的幫助學(xué)校和老師掌握學(xué)生的情況,為學(xué)生提供成績跟課程方面的查詢。在傳統(tǒng)模式下利用人工進行學(xué)生信息管理,存在著較多的缺點,如:效率底,保密性差,時間一長將產(chǎn)生大量的文件和數(shù)據(jù),更不便于查找,更新,維護等。諸如

11、這些情況,令學(xué)校管理者對學(xué)生的信息管理帶來了很大困難,嚴重影響了教育工作者的工作效率。隨著科學(xué)技術(shù)的不斷提高,計算機科學(xué)日漸成熟, 使用日趨成熟的計算機技術(shù)來代替?zhèn)鹘y(tǒng)的人工模式,來實現(xiàn)學(xué)生信息的現(xiàn)代化管理,其強大的功能已為人們深刻認識,它已進入人類社會的各個領(lǐng)域并發(fā)揮著越來越重要的作用。作為計算機應(yīng)用的一部分,使用計算機對學(xué)生信息進行管理,具有著手工管理所無法比擬的優(yōu)點.例如:檢索迅速、查找方便、易修改、可靠性高、存儲量大、數(shù)據(jù)處理快捷、保密性好、壽命長、成本低、便于打印等。這些優(yōu)點能夠極大地提高學(xué)生信息管理的效率,也是學(xué)校的科學(xué)化、正規(guī)化管理,與世界接軌的重要條件。用計算機制作的學(xué)生信息管理

12、系統(tǒng)還可以通過功能強大的Internet網(wǎng)及時的向?qū)W生的家長傳遞該生在校的最新成績,有助于學(xué)校與家長的信息互動,為更好地把握學(xué)校的教育方針一定的促進作用!因此,開發(fā)這樣一套管理軟件成為很有必要的事情。2系統(tǒng)技術(shù)及運行環(huán)境2.1 Visual Basic 6.0簡介Visual Basic 6.0是Microsoft公司成功的變成語言產(chǎn)品之一,在全世界有數(shù)以百萬計的用戶。它之所以受到人們的青睞,原因是多方面的,但主要的有兩點,一是功能強大,二是容易掌握。隨著版本的更新,Visual Basic已成為真正專業(yè)化的大型開發(fā)語言和環(huán)境,不公功能越來越強,而且更容易使用Visual Basic6.0所提

13、供的開發(fā)環(huán)境與Windows具有完全一致的界面,使用更方便,其代碼效率已達到VisualC+的水平。2.2系統(tǒng)開發(fā)及運行環(huán)境該運行環(huán)境的規(guī)定是保證本需求說明的功能得到實際真正體現(xiàn)的基礎(chǔ)。(1)運行環(huán)境WindowsXP或更高版本的操作系統(tǒng)數(shù)據(jù)庫系統(tǒng):Microsoft SQL Server 2000(2)開發(fā)環(huán)境:開發(fā)工具:Microsoft Visual Basic 6.0數(shù)據(jù)庫系統(tǒng):Microsoft SQL Server 20003 系統(tǒng)分析3.1需求分析21世紀以來,人類經(jīng)濟高速發(fā)展,人們發(fā)生了日新月異的變化,特別是計算機的應(yīng)用及普及到經(jīng)濟和社會生活的各個領(lǐng)域。使原本的舊的管理方法越來

14、越不適應(yīng)現(xiàn)在社會的發(fā)展。許多人還停留在以前的手工操作。這大大地阻礙了人類經(jīng)濟的發(fā)展。為了適應(yīng)現(xiàn)代社會人們高度強烈的時間觀念,學(xué)校信息管理系統(tǒng)軟件為學(xué)校辦公室?guī)砹藰O大的方便。(一)教育系統(tǒng)學(xué)生管理現(xiàn)狀分析學(xué)校工作流程分析學(xué)校工作總體規(guī)劃由教務(wù)人員在學(xué)生信息管理系統(tǒng)中完成對運行教務(wù)處所需的基本數(shù)據(jù)的維護,包括這些信息的增加、修改及對各項信息的變動都將在這進行操作。新的學(xué)年,教務(wù)人員首先加入年級信息,然后編排班級,再對來校學(xué)生進行基本的信息錄入,新生入學(xué)后由教務(wù)人員在學(xué)籍系統(tǒng)中完成新學(xué)生信息的維護。(二)學(xué)校具體需求分析學(xué)生:對各科成績的查詢?nèi)握n老師:輸入并維護所教科目的學(xué)生成績教務(wù)處: 學(xué)校全體

15、成員的信息管理,并對任課老師,班主任等輸入的信息進行存庫,對學(xué)生的信息進行必要的維護。通過研究調(diào)查,本系統(tǒng)需以下功能:綜合學(xué)生信息、學(xué)生成績以及信息查詢等信息。方便用戶了解和管理學(xué)生的全面動態(tài)信息。良好的界面設(shè)計,更人性化的設(shè)計理念,使用戶擁有更輕松的使用心情。3.2可行性分析目的:可行性研究的目的是用最小的代價在盡可能的時間內(nèi)確定問題是否能解決。經(jīng)濟性:由于學(xué)校等中小型管理系統(tǒng)并不復(fù)雜,且Visual Basic 6.0本身要求的運行環(huán)境不高,所以一般Windows 2000以上的系統(tǒng)環(huán)境都可以使用。實用性:本學(xué)生信息管理系統(tǒng)管理系統(tǒng)無太多復(fù)雜的操作要求,也沒有過分花哨的裝飾品,人性化的設(shè)計

16、界面可以使操作者輕易運用自如 4系統(tǒng)設(shè)計4.1 設(shè)計目標本系統(tǒng)可以能減少很多不必要的資源,不用象以前那樣用冗余的紙張式的管理。大節(jié)省了學(xué)校能源。并且計算機的存儲與快速查詢功能大大提高了學(xué)籍管理的效率,并且還提高了學(xué)籍信息管理的精確度。方便快速的操作,可減少學(xué)籍信息管理的漏洞,又減少因工作的冗余出現(xiàn)的錯誤,并且操作非常簡單,可減少許多不很必要的人員,這無論從物質(zhì)上還是工作人員的工資上都為學(xué)校節(jié)約了開支。為學(xué)校增加了財富。數(shù)據(jù)庫分析用戶需求具體有學(xué)籍管理系統(tǒng)提供保存、更新、查詢、維護,這就需求數(shù)據(jù)庫結(jié)構(gòu)能充分滿足各種信息的輸入與輸出,實現(xiàn)有組織地、動態(tài)地存儲大量關(guān)聯(lián)數(shù)據(jù),方便用戶訪問系統(tǒng)中的數(shù)據(jù),

17、它與文件系統(tǒng)的重要區(qū)別是數(shù)據(jù)的充分共享,交叉訪問,與應(yīng)用程序的高度獨立性。4.2項目規(guī)劃學(xué)生管理系統(tǒng)是各大中專院校不可缺少的一部分,是一個VB+SQL數(shù)據(jù)庫開發(fā)應(yīng)用程序,它主要包括用戶登錄、學(xué)生信息輸入修改、學(xué)生信息查詢以及學(xué)生成績輸入、學(xué)生成績查詢、系統(tǒng)用戶管理等幾個頁面,因而該系統(tǒng)具有較強的實用性。4.3系統(tǒng)流程圖系統(tǒng)初始化附加數(shù)據(jù)庫系統(tǒng)登錄系統(tǒng)主界面學(xué)生成績信息管理學(xué)生課程信息管理系統(tǒng)管理學(xué)生信息管理理學(xué)生成績錄入學(xué)生選課課程查詢學(xué)生信息錄入學(xué)生信息修改學(xué)生成績查詢修改密碼用戶管理5系統(tǒng)詳細設(shè)計5.1數(shù)據(jù)庫需求分析課程設(shè)置學(xué)生注冊考核信息課程信息管理其它系統(tǒng)數(shù)據(jù)接口考核信息管理考核輸入課

18、程選擇學(xué)生信息管理個人信息輸入 5.2數(shù)據(jù)庫邏輯結(jié)構(gòu)設(shè)計(1)kc(課程)見表1表5-1字段名數(shù)據(jù)類型是否允許為空說明課程號Char(3)Not null主鍵課程名Char(16)Not null開課學(xué)期tinyintNot null只能為1-8學(xué)時tinyintNot null學(xué)分tinyintnull(2)xs_kc(學(xué)生選課)見表2表5-2字段名數(shù)據(jù)類型是否允許為空說明學(xué)號Char(6)Not null主鍵課程號Char(3)Not null主鍵成績tinyintnull學(xué)分tinyintnull(3)xs(學(xué)生)見表3表5-3字段名數(shù)據(jù)類型是否允許為空說明學(xué)號Char(6)Not nu

19、ll主鍵姓名Char(8)Not null專業(yè)名Char(10)null性別Bit Null男1,女0出生日期SmallDatetimeNull總學(xué)分tinyintnull照片imageNull備注textNull(4)user1(管理員登錄)見表4表5-4 字段名數(shù)據(jù)類型說明角色Char(3)用戶名Char(6)主鍵 密碼Char(6)Not null(5)user2(學(xué)生登錄)見表5 表5-5字段名數(shù)據(jù)類型說明角色Char(3)用戶名Char(6)主鍵密碼Char(6)6.系統(tǒng)實現(xiàn)6.1系統(tǒng)初始界面圖6-1“系統(tǒng)初始界面代碼”Dim starttime As StringDim endti

20、me As StringDim i As IntegerPrivate Sub Form_Load()starttime = Format(Now, hh:mm:ss)End SubPrivate Sub Timer1_Timer()Dim ret As Integerendtime = Format(Now, hh:mm:ss)If DateDiff(s, starttime, endtime) = 10 Then Dim cn As ADODB.Connection Set cn = New ADODB.Connection Dim sqlres As ADODB.Recordset cn

21、.Open Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;userid=sa;Initial Catalog=master Set sqlres = New ADODB.Recordset sqlres.Open SELECT * FROM master.sysdatabases WHERE name = xscj, cn, adOpenDynamic, adLockPessimistic If sqlres.EOF = False Then Label1.Caption = 登陸成功 cn.C

22、lose Unload Me Form1.Show Else ret = MsgBox(是否加載數(shù)據(jù)庫, vbYesNo, XSCJ) If ret = vbYes Then cn.Close Unload Me Form12.Show Else cn.Close End End If End IfEnd IfEnd SubPrivate Sub Timer2_Timer()Dim str As Stringstr = 系統(tǒng)加載中,請等待.i = i + 1If i = 20 Then i = 0 Label1.Caption = Else Label1.Caption = Label1.Ca

23、ption & Mid(str, i, 1)End IfEnd Sub6.2附加數(shù)據(jù)庫圖6-2“附加Server數(shù)據(jù)庫”按鈕的click事件添加如下的代碼Private Sub Command2_Click()If Text1.Text = Then MsgBox 請選擇數(shù)據(jù)庫文件!, , XSCJ Exit SubEnd IfOn Error GoTo dataerrcn.Open Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;userid=sa;Initial Catalog=masterc

24、n.Execute (sp_attach_db dbname= & strdata & ,filename1= & m & )MsgBox 附加成功!, , XSCJcn.CloseUnload MeForm1.ShowExit Subdataerr:MsgBox Err.Description, , XSCJcn.CloseEnd Sub6.3登陸界面設(shè)計圖6-3“登錄”按鈕的click事件添加如下的代碼:Private Sub Command1_Click()If Text1.Text = Or Text2.Text = Then MsgBox 請輸入完整的登錄信息! Text1.SetF

25、ocus Exit SubEnd IfIf Text3.Text = Then MsgBox 請輸入驗證碼 Text3.SetFocus Exit SubEnd IfDim i As Integeri = Len(Text1.Text)If i 6 Then MsgBox 用戶名應(yīng)為六位數(shù)字, , 提示 Text1.SetFocus Text1.Text = Exit SubEnd Ifi = Len(Text2.Text)If i 6 Then MsgBox 密碼應(yīng)為六位, , 提示 Text2.SetFocus Text2.Text = Exit SubEnd IfIf UCase(Tri

26、m(Text3.Text) Trim(Label4.Caption) Then MsgBox 驗證碼輸入錯誤 Text3.SetFocus Text3.Text = Exit SubEnd IfDim sqlcon As New ADODB.ConnectionDim sqlres As New ADODB.RecordsetSet sqlcon = New ADODB.Connectionsqlcon.Open connectstringIf option1.Value Then Set sqlres = New ADODB.Recordset sqlres.Open select * fr

27、om dlgl where 用戶名= + Trim(Text1.Text) + and 密碼= + Trim(Text2.Text) + , connectstring, adOpenDynamic, adLockPessimistic If Not sqlres.EOF Then juese = option1.Caption yonghuming = Trim(Text1.Text) mima = Trim(Text2.Text) MsgBox 登錄成功 sqlres.Close Unload Me MDIForm1.Show Exit Sub Else sqlres.Close MsgB

28、ox 用戶名或密碼錯誤! Text1.Text = Text2.Text = Text3.Text = Text1.SetFocus Randomize i = Int(Rnd * 25 + 65) j = Int(Rnd * 25 + 65) k = Int(Rnd * 25 + 65) l = Int(Rnd * 25 + 65) Label4.Caption = Chr(i) & Chr(j) & Chr(k) & Chr(l) Exit Sub End IfEnd IfIf Option2.Value Then Set sqlres = New ADODB.Recordset sqlr

29、es.Open select * from dl where 用戶名= + Trim(Text1.Text) + and 密碼= + Trim(Text2.Text) + , connectstring, adOpenDynamic, adLockPessimistic If Not sqlres.EOF Then juese = Option2.Caption yonghuming = Trim(Text1.Text) mima = Trim(Text2.Text) MsgBox 登錄成功 sqlres.Close Unload Me MDIForm1.Show Exit Sub Else

30、sqlres.Close MsgBox 用戶名或密碼錯誤! Text1.Text = Text2.Text = Text3.Text = Text1.SetFocus Randomize i = Int(Rnd * 25 + 65) j = Int(Rnd * 25 + 65) k = Int(Rnd * 25 + 65) l = Int(Rnd * 25 + 65) Label4.Caption = Chr(i) & Chr(j) & Chr(k) & Chr(l) End IfEnd IfEnd Sub6.4學(xué)生信息錄入圖6-4“更新”按鈕的click事件添加如下的代碼:Private S

31、ub Command1_Click()Set sqlres = New ADODB.RecordsetAdodc2.RecordSource = select * from xs where 學(xué)號= & Trim(Text1.Text) & Adodc2.CommandType = adCmdTextAdodc2.RefreshDim s As StringDim bytedata() As ByteDim adofld As ADODB.Fields = select * from xs where 學(xué)號= & Trim(Text1.Text) & sqlres.Open s, connec

32、tstring, adOpenDynamic, adLockPessimisticIf Not sqlres.EOF Then sqlres.Fields(1) = Trim(Text2.Text) sqlres.Fields(2) = Combo1.Text If Option1.Value = True Then sqlres.Fields(3) = 1 Else sqlres.Fields(3) = 0 End If If Trim(Text5.Text) Then sqlres.Fields(5) = CInt(Text5.Text) End If sqlres.Fields(7) =

33、 Trim(Text4.Text) sqlres.Fields(4) = DTPicker1.Value Set adofld = sqlres.Fields(照片) If CommonDialog1.filename Then Call picsavetodb(adofld, filename) End If sqlres.Update Adodc1.Refresh MsgBox 修改學(xué)生信息成功!, vbOKOnly + vbExclamation, 修改學(xué)生信息Else sqlres.AddNew sqlres.Fields(0) = Trim(Text1.Text) sqlres.Fi

34、elds(1) = Trim(Text2.Text) sqlres.Fields(2) = Combo1.Text If Option1.Value = True Then sqlres.Fields(3) = 1 Else sqlres.Fields(3) = 0 End If If Trim(Text5.Text) Then sqlres.Fields(5) = CInt(Text5.Text) End If sqlres.Fields(7) = Trim(Text4.Text) sqlres.Fields(4) = DTPicker1.Value Set adofld = sqlres.

35、Fields(照片) If CommonDialog1.filename Then Call picsavetodb(adofld, filename) End If sqlres.Update Adodc1.Refresh Adodc1.Recordset.MoveLast MsgBox 添加學(xué)生信息成功!, vbOKOnly + vbExclamation, 添加學(xué)生信息End If CommonDialog1.filename = sqlres.Close Adodc1.RecordSource = select * from xs,cxb where xs.性別=cxb.性別0End

36、Sub6.5 學(xué)生信息修改圖6-56.6 學(xué)生信息查詢圖6-6“查詢”按鈕的click事件添加如下的代碼Private Sub Command1_Click()Dim str As Stringstr = select * from xs,cxb where xs.性別=cxb.性別0 If Text1.Text = And Text2.Text = And Combo1.Text 所有專業(yè) Then str = select * from xs,cxb where 專業(yè)名= + Trim(Combo1.Text) + and xs.性別=cxb.性別0 End IfIf Text1.Text

37、 = And Text2.Text = And Combo1.Text = 所有專業(yè) Then str = select * from xs,cxb where xs.性別=cxb.性別0End IfIf Text1.Text And Text2.Text = Thenstr = select * from xs,cxb where 學(xué)號= & Trim(Text1.Text) & and xs.性別=cxb.性別0End IfIf Text1.Text And Text2.Text Thenstr = select * from xs where 學(xué)號= & Trim(Text1.Text)

38、 & and 姓名= & Trim(Text2.Text) & End IfIf Text1.Text = And Text2.Text Thenstr = select * from xs where 姓名= & Trim(Text2.Text) & End Ifstr = select * from xs where 學(xué)號= & Trim(Text1.Text) & or 姓名= & Trim(Text2.Text) & or 專業(yè)名= & Trim(Combo1.Text) & Adodc1.RecordSource = strAdodc1.CommandType = adCmdText

39、Adodc1.RefreshIf Adodc1.Recordset.EOF Then Text2.Text = Combo1.Text = 所有專業(yè) Adodc1.RecordSource = select * from xs,cxb where xs.性別=cxb.性別0 Adodc1.Refresh Adodc1.Recordset.MoveFirstEnd IfIf Text1.Text Or Text2.Text Then Combo1.Text = Adodc1.Recordset(專業(yè)名)End IfEnd Sub6.7學(xué)生成績錄入圖6-7“更新”按鈕的click事件添加如下的代碼

40、Private Sub Command1_Click()Dim 學(xué)號, 課程名, 成績, 學(xué)分If Trim(Text2.Text) = Then MsgBox 成績不能為空,請輸入完整的信息!, , 提示 Text2.SetFocus Exit SubEnd Ifsqlcmd.CommandText = addscoresqlcmd.CommandType = adCmdStoredProcSet 學(xué)號 = sqlcmd.CreateParameter(學(xué)號, adVarChar, adParamInput, 6)sqlcmd.Parameters.Append (學(xué)號)Set 課程名 =

41、sqlcmd.CreateParameter(課程名, adVarChar, adParamInput, 16)sqlcmd.Parameters.Append (課程名)Set 成績 = sqlcmd.CreateParameter(成績, adInteger, adParamInput)sqlcmd.Parameters.Append (成績)Set 學(xué)分 = sqlcmd.CreateParameter(學(xué)分, adInteger, adParamInput)sqlcmd.Parameters.Append (學(xué)分)sqlcmd(學(xué)號) = Combo3.Textsqlcmd(課程名)

42、= Combo2.Textsqlcmd(成績) = CInt(Text2.Text)sqlcmd(學(xué)分) = 0Set sqlres = sqlcmd.ExecuteMsgBox 更新選課成績成功, , 提示sqlcmd.Parameters.Delete (學(xué)號)sqlcmd.Parameters.Delete (課程名)sqlcmd.Parameters.Delete (成績)sqlcmd.Parameters.Delete (學(xué)分)Adodc1.RecordSource = select xs_kc.學(xué)號,姓名,專業(yè)名,課程名,成績,xs_kc.學(xué)分 from xs,kc,xs_kc w

43、here 課程名= + Trim(Combo2.Text) + and 專業(yè)名= + Trim(Combo1.Text) + and xs.學(xué)號=xs_kc.學(xué)號 and kc.課程號=xs_kc.課程號Adodc1.RefreshAdodc1.Recordset.MoveLastEnd Sub6.8 修改學(xué)生成績圖6-86.9學(xué)生成績查詢圖6-96.10用戶管理圖6-10窗體的代碼如下Private sqlcon As New ADODB.ConnectionPrivate sqlres As New ADODB.RecordsetPrivate Sub Command1_Click()sq

44、lres.MoveFirstText1.Text = sqlres.Fields(0)Text2.Text = sqlres.Fields(1)Text3.Text = sqlres.Fields(2)End SubPrivate Sub Command2_Click()sqlres.MovePreviousIf sqlres.BOF Then sqlres.MoveFirstEnd IfText1.Text = sqlres.Fields(0)Text2.Text = sqlres.Fields(1)Text3.Text = sqlres.Fields(2)End SubPrivate Su

45、b Command3_Click()sqlres.MoveNextIf sqlres.EOF Then sqlres.MoveLastEnd IfText1.Text = sqlres.Fields(0)Text2.Text = sqlres.Fields(1)Text3.Text = sqlres.Fields(2)End SubPrivate Sub Command4_Click()sqlres.MoveLastText1.Text = sqlres.Fields(0)Text2.Text = sqlres.Fields(1)Text3.Text = sqlres.Fields(2)End

46、 SubPrivate Sub Command5_Click()Dim a As Integera = MsgBox(是否刪除角色為: & Trim(Text1.Text) & 用戶名為: + Trim(Text2.Text) + 記錄?, vbYesNo, 提示)If a = 6 Thensqlres.Deletesqlres.UpdateEnd IfEnd SubPrivate Sub Command6_Click()Unload MeFrmMain.ShowEnd SubPrivate Sub Form_Load()Me.Height = 5355Me.Left = 5000Me.Top

47、 = 2000Me.Width = 7515Set sqlcon = New ADODB.Connectionsqlcon.Open connectstringSet sqlres = New ADODB.Recordset sqlres.Open select * from dlgl , connectstring, adOpenDynamic, adLockPessimisticIf Not sqlres.EOF Then Text1.Text = sqlres.Fields(0) Text2.Text = sqlres.Fields(1) Text3.Text = sqlres.Fiel

48、ds(2)Else MsgBox 無記錄 Command1.Enabled = False Command2.Enabled = False Command3.Enabled = False Command4.Enabled = False Command5.Enabled = False Exit SubEnd IfEnd SubPrivate Sub Form_Unload(Cancel As Integer)sqlcon.CloseEnd Sub6.11修改用戶密碼圖6-11“確定”按鈕的click事件添加如下的代碼Private Sub Command1_Click()If Text1

49、.Text = Or Text2.Text = Or Text3.Text = Then MsgBox 請輸入完整信息 Text1.SetFocus Exit SubEnd Ifi = Len(Text1.Text)If i 6 Then MsgBox 密碼應(yīng)為六位, , 提示 Text1.SetFocus Text1.Text = Exit SubEnd Ifi = Len(Text2.Text)If i 6 Then MsgBox 密碼應(yīng)為六位, , 提示 Text2.SetFocus Text2.Text = Exit SubEnd IfIf Trim(Text3.Text) Trim(

50、Text2.Text) Then MsgBox 前后輸入的密碼不一致! Text3.SetFocus Text3.Text = Exit SubEnd IfIf juese = 管理員 Then Set sqlres = New ADODB.Recordset sqlres.Open select * from dlgl where 用戶名= + yonghuming + and 密碼= + Trim(Text1.Text) + , connectstring, adOpenDynamic, adLockPessimistic If Not sqlres.EOF Then sqlres.Fields(2) = Trim(Text2.Text) sqlres.Update Else MsgBox 原密碼輸入有誤 Text1.SetFocus Text1.Text = Text2.Text = Text3.Text = Exit Sub End IfEnd IfIf juese = 學(xué)生 Then Set sqlres = New ADODB.Recordset sq

溫馨提示

  • 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)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論