圖書管理系統(tǒng)畢業(yè)論文(優(yōu)秀畢業(yè)論文)_第1頁(yè)
圖書管理系統(tǒng)畢業(yè)論文(優(yōu)秀畢業(yè)論文)_第2頁(yè)
圖書管理系統(tǒng)畢業(yè)論文(優(yōu)秀畢業(yè)論文)_第3頁(yè)
圖書管理系統(tǒng)畢業(yè)論文(優(yōu)秀畢業(yè)論文)_第4頁(yè)
圖書管理系統(tǒng)畢業(yè)論文(優(yōu)秀畢業(yè)論文)_第5頁(yè)
已閱讀5頁(yè),還剩47頁(yè)未讀 繼續(xù)免費(fèi)閱讀

下載本文檔

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

文檔簡(jiǎn)介

1、圖書管理系統(tǒng)論文(vb+sql)目 錄內(nèi)容摘要2引言.2第一章 課題簡(jiǎn)介.3第二章 需求分析.42.1圖書管理現(xiàn)狀.42.2數(shù)據(jù)流程圖. 5第三章 系統(tǒng)邏輯和物理設(shè)計(jì).83.1數(shù)據(jù)庫(kù)的設(shè)計(jì).83.2功能模塊的實(shí)現(xiàn).9第四章 調(diào)試與分析.504.1存在問(wèn)題及解決方案.504.2進(jìn)一步改進(jìn)設(shè)想.50第五章 用戶操作說(shuō)明505.1軟硬件環(huán)境.505.2應(yīng)用系統(tǒng)安裝.505.3操作手冊(cè).50小結(jié).51參考文獻(xiàn).52內(nèi)容摘要圖書管理系統(tǒng)是采用visual basic6.0開發(fā)的一個(gè)數(shù)據(jù)庫(kù)管理系統(tǒng)。開發(fā)本系統(tǒng)的基本步驟:需求分析、系統(tǒng)概念設(shè)計(jì)、系統(tǒng)邏輯和物理設(shè)計(jì)、系統(tǒng)實(shí)現(xiàn)和維護(hù)。在系統(tǒng)分析中先后用數(shù)據(jù)字典

2、、數(shù)據(jù)流程、系統(tǒng)的功能結(jié)構(gòu)圖、er圖分析了系統(tǒng)所需的各種數(shù)據(jù)。在系統(tǒng)的設(shè)計(jì)過(guò)程中,我們采用了模塊獨(dú)立設(shè)計(jì)法,比較詳細(xì)的展現(xiàn)了各個(gè)模塊的功能。在庫(kù)和表的設(shè)計(jì)當(dāng)中, 我們力求層次清晰,設(shè)計(jì)簡(jiǎn)單實(shí)用。在系統(tǒng)具體實(shí)行階段中,我們精心細(xì)致的畫出了各個(gè)窗體并給出了相應(yīng)的事件和代碼,以實(shí)現(xiàn)各個(gè)窗體的作用。本系統(tǒng)雖然設(shè)計(jì)簡(jiǎn)單,但有一定的實(shí)用性。系統(tǒng)的功能較為全面,使用簡(jiǎn)單,基本上可以作為一般大中小學(xué)的圖書管理系統(tǒng)。關(guān)鍵字:數(shù)據(jù)庫(kù) sql 語(yǔ)言 visual basic6.0 圖書 圖書管理 窗體 引言當(dāng)今時(shí)代是飛速發(fā)展的的信息時(shí)代。在各行各業(yè)中離不開信息處理,這正是計(jì)算機(jī)被廣泛應(yīng)用于信息管理系統(tǒng)的原因。計(jì)算機(jī)

3、的最大好處在于利用它能夠進(jìn)行信息管理。使用計(jì)算機(jī)進(jìn)行信息控制,不僅提高了工作效率,而且大大的提高了其安全性。尤其對(duì)于復(fù)雜的信息管理,計(jì)算機(jī)能夠充分發(fā)揮它的優(yōu)越性。計(jì)算機(jī)進(jìn)行信息管理與信息管理系統(tǒng)的開發(fā)密切相關(guān),系統(tǒng)的開發(fā)是系統(tǒng)管理的前提。本系統(tǒng)就是為了管理好圖書館信息而設(shè)計(jì)的。圖書館作為一種信息資源的集散地,圖書和用戶借閱資料繁多,包含很多的信息數(shù)據(jù)的管理,現(xiàn)今,有很多的圖書館都是初步開始使用,甚至尚未使用計(jì)算機(jī)進(jìn)行信息管理。根據(jù)調(diào)查得知,他們以前對(duì)信息管理的主要方式是基于文本,表格等紙介質(zhì)的手工處理,對(duì)于圖書借閱情況(如借書天數(shù),超過(guò)限定借書時(shí)間的天數(shù))的統(tǒng)計(jì)和核實(shí)等往往采用對(duì)借書卡的人工檢

4、查進(jìn)行,對(duì)借閱者的借閱權(quán)限,以及借閱天數(shù)等用人工計(jì)算,手抄進(jìn)行。數(shù)據(jù)處理工作量大,容易出錯(cuò)。由于數(shù)據(jù)繁多,容易丟失,且不易查找。總的來(lái)說(shuō),缺乏系統(tǒng)規(guī)范的信息管理手段。盡管有的圖書館有計(jì)算機(jī),但是尚未用于信息管理,沒(méi)有發(fā)揮它的效力,資源閑置比較突出,這就是管理信息系統(tǒng)的開發(fā)的基于環(huán)境。基于這個(gè)問(wèn)題,我認(rèn)為有必要建立一個(gè)圖書管理系統(tǒng),使圖書管理工作規(guī)范化,系統(tǒng)化,程序化,避免圖書管理的隨意性,提高信息處理的速度和準(zhǔn)確性,能夠及時(shí),準(zhǔn)確,有效的查詢和修改圖書情況。第一章 課題簡(jiǎn)介課題:圖書管理系統(tǒng)。任務(wù):針對(duì)各大中專院校的圖書管理現(xiàn)狀,設(shè)計(jì)出適合一般學(xué)校的計(jì)算機(jī)輔助圖書管理系統(tǒng)。實(shí)現(xiàn)對(duì)圖書基本信息、

5、讀者基本信息進(jìn)行計(jì)算機(jī)輔助管理,完成借書和還書有關(guān)信息的記錄、修改、查詢、刪除等一系列任務(wù)的計(jì)算機(jī)管理與實(shí)現(xiàn).。開發(fā)環(huán)境:本圖書管理開發(fā)系統(tǒng)是在pentyum 4 以上機(jī)型的計(jì)算機(jī)上進(jìn)行開發(fā)并獲得通過(guò)的,同時(shí)方便系統(tǒng)開發(fā),減少開發(fā)過(guò)程的難度,我們是基于以下的軟件環(huán)境。以windows 98為操作系統(tǒng)以visual basic6.0為開發(fā)工具以microsoft sql server作為后臺(tái)數(shù)據(jù)庫(kù)功能概述:該系統(tǒng)界面完好,操作簡(jiǎn)便,能完成添加圖書信息,修改圖書信息,查詢圖書信息,添加讀者類別,修改讀者類別,查詢讀者信息,修改讀者信息,添加刪除管理員等一系列圖書管理功能,開發(fā)本系統(tǒng)的總體任務(wù)是實(shí)現(xiàn)

6、圖書管理的系統(tǒng)化和自動(dòng)化,幫助管理人員更好更高效地完成圖書管理工作。本著實(shí)用性和介紹性的原則,整個(gè)系統(tǒng)由五大模塊組成,每個(gè)大的模塊又包括三至四個(gè)小的模塊。一、 圖書管理部分:包括圖書信息管理和類別管理,其功能是實(shí)現(xiàn)對(duì)各部分?jǐn)?shù)據(jù)內(nèi)容進(jìn)行添加、修改、查詢等操作。二、 借閱管理部分:包括借書管理和還書管理,其功能是實(shí)現(xiàn)對(duì)各部分?jǐn)?shù)據(jù)內(nèi)容的添加和查詢等操作。三、 讀者管理部分:包括讀者信息管理和讀者類別管理,其功能是實(shí)現(xiàn)對(duì)各部分?jǐn)?shù)據(jù)內(nèi)容的添加和修改等操作。四、 系統(tǒng)管理部分:包括修改系統(tǒng)用戶密碼和增加新用戶兩項(xiàng)功能。 五、 幫助部分:顯示關(guān)于信息。系統(tǒng)具有高效、易操作、易維護(hù)等特點(diǎn),并且系統(tǒng)結(jié)構(gòu)清晰、界

7、面友好,功能較為齊全,能有效地協(xié)助管理人員進(jìn)行圖書管工作。如果想真正把它用到圖書館的圖書自動(dòng)化管理中,還需要讀者對(duì)該系統(tǒng)進(jìn)行一步的完善工作。第二章 需求分析需求分析階段確定的系統(tǒng)邏輯模型是以后設(shè)計(jì)和實(shí)現(xiàn)目標(biāo)系統(tǒng)的基礎(chǔ),因此必須準(zhǔn)確完整地體現(xiàn)用戶的要求。在這一章里,我將給出系統(tǒng)的數(shù)據(jù)流圖,功能結(jié)構(gòu)圖,數(shù)據(jù)字典,為系統(tǒng)的設(shè)計(jì)奠定基礎(chǔ)。2.1圖書管理現(xiàn)狀隨著計(jì)算機(jī)技術(shù)的飛速發(fā)展,其應(yīng)用方面已滲透到社會(huì)生活的各個(gè)領(lǐng)域。它已經(jīng)成為我們學(xué)習(xí)和工作的得力助手。在學(xué)校,尤其是在一些高校,圖書是學(xué)校的一項(xiàng)重要資源,圖書的管理也是學(xué)校的一項(xiàng)常規(guī)性的重要工作。而長(zhǎng)期以來(lái),學(xué)生圖書管理都是依賴人工進(jìn)行的。現(xiàn)今,有很多

8、的學(xué)校都已經(jīng)開始使用計(jì)算機(jī)進(jìn)行圖書信息管理,并且起得良好的效果。近年來(lái)我校招生情況越來(lái)越好,所以圖書管理工作越來(lái)越繁重,但由于種種原因,管理人員并沒(méi)有增加,因此原有的人工管理工作已不能適應(yīng)現(xiàn)行的工作需要。同時(shí),陳舊的人工管理也不利于推廣計(jì)算機(jī)應(yīng)用。為使圖書管理工作科學(xué)化、規(guī)范化,就必須采用計(jì)算機(jī)輔助管理。2.2 數(shù)據(jù)流程圖數(shù)據(jù)流程圖(data flow dfd)是描述實(shí)際業(yè)務(wù)管理系統(tǒng)工作流程的一種圖形表示法。它描繪系統(tǒng)的邏輯模型圖,其中沒(méi)有任何具體的物理元素,只是描繪信息在系統(tǒng)中流動(dòng)和處理的情況。因?yàn)閿?shù)據(jù)流程圖是邏輯系統(tǒng)的圖形表示,即使不是專業(yè)的計(jì)算機(jī)技術(shù)人員也容易理解,所以是極好的通信工具。

9、此外,設(shè)計(jì)數(shù)據(jù)流程圖只需考慮系統(tǒng)必須完成的基本邏輯功能,完全不需要考慮如何具體地實(shí)現(xiàn)這些功能,所以它也是軟件設(shè)計(jì)的很好的出發(fā)點(diǎn)。圖書管理系統(tǒng)主要是為了對(duì)圖書、讀者基本信息等進(jìn)行計(jì)算機(jī)管理。下面就是功能模塊的流程分析:2.2.1 圖書管管理系統(tǒng)基本信息流程流程分析:圖書基本信息的流動(dòng)首先是以圖書編號(hào)為流動(dòng)方向的依據(jù),來(lái)達(dá)到添加、修改、記錄、刪除圖書記錄。為了數(shù)據(jù)的一致性,進(jìn)行這些操作的同時(shí),也對(duì)數(shù)據(jù)庫(kù)中的記錄進(jìn)行檢查,檢查是否有重復(fù)的記錄。如有則不能進(jìn)行添加。2.2.2 讀者信息管理基本信息流程圖流程圖分析:讀者基本信息的流動(dòng)首先是以讀者的編號(hào)為依據(jù),來(lái)達(dá)到添加、修改、查詢、刪除讀者信息的記錄。

10、同時(shí),也對(duì)數(shù)據(jù)庫(kù)中的讀者信息表的編號(hào)進(jìn)行檢查。 2.2.3借書管理基本信息流程圖 流程圖分析:借書管理基本信息的流動(dòng)首先是以借閱編號(hào)為流動(dòng)方向的依據(jù),來(lái)達(dá)到添加、查詢借書記錄。為了數(shù)據(jù)的一致性,進(jìn)行這些操作的同時(shí),也對(duì)數(shù)據(jù)庫(kù)中的記錄進(jìn)行檢查,檢查是否有重復(fù)的記錄。如沒(méi)有則可進(jìn)行添加。2.2.4 還書管理基本信息流程圖流程圖分析:借閱管理部分是實(shí)現(xiàn)對(duì)各部分?jǐn)?shù)據(jù)內(nèi)容的添加和查詢操作,在借閱信息中包括圖書編號(hào)、讀者編號(hào),系統(tǒng)對(duì)借書日期進(jìn)行自動(dòng)添加。并通過(guò)添加功能來(lái)達(dá)到借閱信息表的數(shù)據(jù)的更新,通過(guò)查詢功能可使管理員很快地了解借閱信息,從而避免書籍的丟失現(xiàn)象產(chǎn)生。通過(guò)上面對(duì)各個(gè)模塊流程的分析,那么我們就

11、不難對(duì)整個(gè)系統(tǒng)的大致流程有一個(gè)全面的認(rèn)識(shí)。設(shè)計(jì)時(shí)采用了常用的自頂向下的瀑布式結(jié)構(gòu)化設(shè)計(jì)方法。這樣系統(tǒng)做起來(lái)后就便于用戶操作。綜合上面各個(gè)模塊的分析,其總體流程圖如下: 啟動(dòng)界面登錄 連接數(shù)據(jù)庫(kù), 驗(yàn)證管理員密碼進(jìn)入主畫面數(shù)據(jù)管理 記錄瀏覽 借還操作 系統(tǒng)設(shè)置 幫助 顯示 關(guān)于信息 讀者 借閱 借閱 歸還 添加 刪除記錄 記錄 書籍 書籍 管理員 管理員添 修 刪加 改 除第三章 系統(tǒng)邏輯和物理設(shè)計(jì)3.1數(shù)據(jù)庫(kù)的設(shè)計(jì)根據(jù)上面的結(jié)構(gòu)圖,現(xiàn)在需要將數(shù)據(jù)庫(kù)結(jié)構(gòu)轉(zhuǎn)化為sql server2000數(shù)據(jù)庫(kù)系統(tǒng)所支持的實(shí)際數(shù)據(jù)模型,也就是數(shù)據(jù)庫(kù)的邏輯結(jié)構(gòu)。形成數(shù)據(jù)庫(kù)中的表格以及各個(gè)表格之間的關(guān)系。圖書管理信息

12、系統(tǒng)數(shù)據(jù)庫(kù)中各個(gè)表格的設(shè)計(jì)結(jié)果如下面的幾個(gè)表格所示。每個(gè)表格表示在數(shù)據(jù)庫(kù)中的一個(gè)表。3.1.1圖書信息表字段名數(shù)據(jù)類型說(shuō)明圖書編號(hào)文本主鍵,字段大小4書名文本字段大小10類別文本字段大小10價(jià)格貨幣類型無(wú)出版社文本字段大小40入庫(kù)日期日期/時(shí)間無(wú)是否借出文本字段大小43.1.2事務(wù)信息表字段名數(shù)據(jù)類型說(shuō)明借閱編號(hào)自動(dòng)編號(hào)無(wú)讀者編號(hào)文本字段大小50圖書編號(hào)文本字段大小50歸還日期日期/時(shí)間無(wú)出借日期日期/時(shí)間無(wú)3.1.3讀者信息表字段名數(shù)據(jù)類型說(shuō)明讀者姓名文本字段大小10讀者編號(hào)文本主鍵,字段大小4年齡數(shù)字無(wú)家庭住址文本字段大小103.2功能模塊的實(shí)現(xiàn)按結(jié)構(gòu)化的程序設(shè)計(jì)思想,在完成了系統(tǒng)分析、系

13、統(tǒng)設(shè)計(jì)后,就可以進(jìn)行系統(tǒng)實(shí)現(xiàn)階段了,系統(tǒng)實(shí)現(xiàn)是每指把系統(tǒng)的物理模型轉(zhuǎn)換成實(shí)際運(yùn)行系統(tǒng)的全過(guò)程。在打開數(shù)據(jù)表之前應(yīng)該先打開數(shù)據(jù)庫(kù),系統(tǒng)中創(chuàng)建了一個(gè)模塊,該模塊的作用是連接數(shù)據(jù)庫(kù)以及數(shù)據(jù)庫(kù)中數(shù)據(jù)的提取,因?yàn)橄到y(tǒng)需要頻繁的使用數(shù)據(jù)庫(kù)中的數(shù)據(jù),建立模塊可以使程序簡(jiǎn)單化,模塊的代碼如下:public cn as adodb.connection定義連接以及取記錄的對(duì)象public rst as adodb.recordset public function cntodb() as booleanon error goto my_debug設(shè)定錯(cuò)誤機(jī)制,當(dāng)連接錯(cuò)誤時(shí)轉(zhuǎn)到my_debug set cn =

14、new adodb.connection with cn設(shè)定訪問(wèn)數(shù)據(jù)庫(kù)的參數(shù),對(duì)象sqlserver,數(shù)據(jù)庫(kù)booksys .connectionstring = provider=sqloledb;uid=sa;pwd=;server=. .connectiontimeout = 5 .cursorlocation = aduseclient .open .defaultdatabase = booksys end with cntodb = true exit functionmy_debug:當(dāng)出錯(cuò)時(shí),取消連接數(shù)據(jù)庫(kù) set con = nothing cntodb = falseend

15、 functionpublic function querydata(byval strsql as string) as boolean on error goto my_debug if cntodb = true then當(dāng)連接到數(shù)據(jù)庫(kù)后才能取得記錄 set rst = new adodb.recordset with rst定義取記錄的參數(shù) .source = strsql .activeconnection = cn .cursorlocation = aduseclient .cursortype = adopendynamic .locktype = adlockoptimist

16、ic .open end with querydata = true end if exit function my_debug: set rst = nothing querydata = falseend functionpublic function getrs(byref rst as adodb.recordset, byval strsql as string) as booleanon error goto rserr set rst = new adodb.recordset with rst .source = strsql .activeconnection = cn .c

17、ursorlocation = aduseclient .cursortype = adopendynamic .locktype = adlockoptimistic .open end with if rst.state then getrs = true exit function end ifrserr: getrs = false msgbox err.number & err.description, vbcritical + vbokonly, 錯(cuò)誤信息end function注意:當(dāng)程序不再使用數(shù)據(jù)庫(kù)時(shí),應(yīng)該調(diào)用connection對(duì)象的close方法將其關(guān)閉,但此時(shí)它還會(huì)占用

18、一定的系統(tǒng)資源,完全將資源釋放給系統(tǒng)的方法是使用下面的語(yǔ)句:set con=nothing.不過(guò),這兩個(gè)步驟往往會(huì)被省略,因?yàn)楫?dāng)程序關(guān)閉時(shí),程序所打開的數(shù)據(jù)也會(huì)隨之關(guān)閉,connection對(duì)象所占用的系統(tǒng)資源也會(huì)自動(dòng)釋放給系統(tǒng).登錄窗體的實(shí)現(xiàn)其代碼如下:private sub command1_click()dim uid定義用戶名變量dim pwd定義密碼的變量 dim strfu as string定義查找用戶名的變量 dim strfp as string定義查找密碼的變量 strfu = select * from yh where userid= & text1.text & 查找

19、與輸入的用戶名一致的用戶名if querydata(strfu) then如果找到了用戶名,則保存記錄符合記錄的條數(shù)uid = rst.recordcountend if strfp = select * from yh where pwd= & text2.text & if querydata(strfp) thenpwd = rst.recordcountend ifif pwd = 1 and uid = 1 then用戶名與密碼數(shù)據(jù)表里都有則顯示主畫面mdiform1.showunload me關(guān)閉本窗口else msgbox 您輸入的用戶名或密碼有錯(cuò)誤!, vbinformatio

20、n + vbokonly, 登錄失敗end ifend subprivate sub command2_click()取消按鈕的點(diǎn)擊事件unload meend subprivate sub form_load()如果沒(méi)有連上數(shù)據(jù)庫(kù),則顯示相應(yīng)信息if cntodb = false then msgbox 網(wǎng)絡(luò)未響應(yīng)!出現(xiàn)此情況可能是與服務(wù)器沒(méi)有物理連接或數(shù)據(jù)庫(kù)不在指向的服務(wù)器上!, vbcritical + vbokonly, connecting errorend iftext1.text = 加載窗體時(shí)清空text1與text2的內(nèi)容text2.text = end sub注意:工程屬性

21、對(duì)話框中的”啟動(dòng)選項(xiàng)”用來(lái)選取擇運(yùn)行vb時(shí)顯示的第一個(gè)窗體,或者sub main.主窗體中的代碼不多,基本上都是實(shí)現(xiàn)單擊某個(gè)菜單選項(xiàng)即彈出相應(yīng)窗體的語(yǔ)句,這些語(yǔ)句將分別在各個(gè)窗體中介紹。單擊“幫助” “關(guān)于”菜單,系統(tǒng)代碼如下:private sub mun_help_about_click()about.showend sub系統(tǒng)主窗體的實(shí)現(xiàn)其代碼如下:private rs as adodb.recordsetprivate rs1 as adodb.recordsetprivate rs2 as adodb.recordsetprivate strsql as stringprivate

22、sub command1_click()borrow.showend subprivate sub command2_click()reback.showend subprivate sub command4_click()text2.text = if cntodb = false then msgbox 網(wǎng)絡(luò)未響應(yīng)!出現(xiàn)此情況可能是與服務(wù)器沒(méi)有物理連接或數(shù)據(jù)庫(kù)不在指向的服務(wù)器上!, vbcritical + vbokonly, connecting errorend ifon error goto fmerr if querydata(select * from book) = true

23、then set datagrid1.datasource = rst else msgbox 查詢失敗! end if exit subfmerr: if rst.bof = true and rst.eof = true then msgbox 沒(méi)有任何記錄! end ifend subprivate sub command5_click()delbook.showend subprivate sub image1_click()dim strf as string搜索按鈕 strf = select * from book where bookname like % & text2.te

24、xt & %if querydata(strf) then set datagrid1.datasource = rstend ifend subprivate sub mdiform_load()text2.text = if cntodb = false then msgbox 網(wǎng)絡(luò)未響應(yīng)!出現(xiàn)此情況可能是與服務(wù)器沒(méi)有物理連接或數(shù)據(jù)庫(kù)不在指向的服務(wù)器上!, vbcritical + vbokonly, connecting errorend ifon error goto fmerr if querydata(select * from book) = true then set data

25、grid1.datasource = rst else msgbox 查詢失敗! end if exit subfmerr: if rst.bof = true and rst.eof = true then msgbox 沒(méi)有任何記錄! end if end subprivate sub mun_add_data_recstu_click()addreader.showend subprivate sub mun_borr_giv_click()reback.showend subprivate sub mun_borr_ow_click()borrow.showend subprivate

26、 sub mun_data_add_recbook_click()addbook.showend subprivate sub mun_del_book_click()delbook.showend subprivate sub mun_del_stu_click()delreader.showend subprivate sub mun_exp_borrow_click()booktran.showend subprivate sub mun_exp_stu_click()reader.showend subprivate sub mun_help_about_click()about.sh

27、owend subprivate sub mun_rework_book_click()reworkbook.showend subprivate sub mun_rework_stu_click()reworkreader.showend subprivate sub mun_sys_admin_click()addmange.showend subprivate sub mun_sys_sys_click()delmange.showend sub數(shù)據(jù)管理的實(shí)現(xiàn)當(dāng)單擊數(shù)據(jù)管理添加書籍記錄菜單時(shí),窗體如下:代碼如下:private sub command1_click()unload mee

28、nd subprivate sub command2_click()on error goto nore if msgbox(確實(shí)要添加嗎?, vbyesno + vbquestion, 提示) = vbyes then call upd rst.update msgbox 添加成功 end if exit subnore: msgbox 圖書編號(hào)重復(fù)或者輸入錯(cuò)誤!, vbokonly + vbcritical, 提示end subprivate sub form_load()text1.text = text2.text = text3.text = text4.text = text5.t

29、ext = text6.text = on error goto fmerr if querydata(select * from book) = true then else msgbox 查詢失敗! end if exit subfmerr: if rst.bof = true and rst.eof = true then msgbox 沒(méi)有任何記錄! end ifend subprivate sub upd() rst.addnew rst.fields(0).value = text1.text rst.fields(1).value = text2.text rst.fields(

30、2).value = text3.text rst.fields(3).value = text4.text rst.fields(4).value = text7.text rst.fields(5).value = text6.text rst.fields(6).value = text5.text rst.updateend sub當(dāng)單擊數(shù)據(jù)管理添加讀者記錄菜單時(shí),彈出如下代碼:添加讀者的窗體代碼如下:private sub command1_click()on error goto error if msgbox(確實(shí)要添加嗎?, vbyesno + vbquestion, 提示)

31、= vbyes then call upd1 rst.update msgbox 添加成功 end if exit suberror: msgbox 讀者編號(hào)重復(fù)或者輸入錯(cuò)誤!, vbokonly + vbcritical, 提示end subprivate sub command2_click()unload meend subprivate sub form_load()text1.text = text2.text = text3.text = text4.text = text5.text = on error goto fmerr if querydata(select * from

32、 reader) = true then else msgbox 查詢失敗! end if exit subfmerr: if rst.bof = true and rst.eof = true then msgbox 沒(méi)有任何記錄! end ifend subprivate sub upd1() rst.addnew rst.fields(0).value = text1.text rst.fields(1).value = text2.text rst.fields(2).value = text3.text rst.fields(3).value = text4.text rst.fie

33、lds(4).value = text5.text rst.updateend sub當(dāng)單擊數(shù)據(jù)管理修改更改書籍菜單時(shí),窗體如下:代碼如下:private sub command2_click()on error goto no call upd2 rst.update rst.movenext if rst.eof or rst.bof then rst.move first end if exit subno: msgbox 修改成功end subprivate sub command3_click()unload meend subprivate sub command5_click()

34、dim strf as string strf = select * from book where bookid like % & text1.text & %if querydata(strf) then text2.text = rst.fields(bookname).value text3.text = rst.fields(booktype).value text4.text = rst.fields(bookprice).value text5.text = rst.fields(bookstate).value text6.text = rst.fields(bookpubli

35、sh).value text7.text = rst.fields(bookintime).value end ifend subprivate sub form_load()text1.text = text2.text = text3.text = text4.text = text5.text = text6.text = text7.text = end subprivate sub upd2() rst.fields(0).value = text1.text rst.fields(1).value = text2.text rst.fields(2).value = text3.t

36、ext rst.fields(3).value = text4.text rst.fields(4).value = text5.text rst.fields(5).value = text6.text rst.fields(6).value = text7.textend sub當(dāng)單擊數(shù)據(jù)管理修改更改讀者菜單時(shí),窗體如下代碼如下:private sub command1_click()unload meend subprivate sub command4_click()on error goto no call upd3 rst.update rst.movenext if rst.eo

37、f or rst.bof then rst.move first end if exit subno: msgbox 修改成功end subprivate sub command5_click()dim strf1 as string strf1 = select * from reader where readerid like % & text1.text & % if querydata(strf1) then text2.text = rst.fields(readername).value text3.text = rst.fields(readerage).value text4.

38、text = rst.fields(readercity).value text5.text = rst.fields(email).value end ifend subprivate sub form_load()text1.text = text2.text = text3.text = text4.text = text5.text = end subprivate sub upd3() rst.fields(0).value = text1.text rst.fields(1).value = text2.text rst.fields(2).value = text3.text r

39、st.fields(3).value = text4.text rst.fields(4).value = text5.textend sub當(dāng)單擊數(shù)據(jù)管理刪除刪除書籍菜單時(shí),窗體如下代碼如下:private sub command1_click()unload meend subprivate sub command2_click()on error goto no call upd2 rst.update rst.movenext if rst.eof or rst.bof then rst.move first end if exit subno: msgbox 修改成功end subp

40、rivate sub command4_click() if rst.eof = true and rst.bof = true then msgbox 沒(méi)有數(shù)據(jù)! else rst.delete rst.movefirst if rst.bof or rst.eof then msgbox 沒(méi)有數(shù)據(jù) call txtcls end if call showdb end ifend subprivate sub command5_click()dim strf as string strf = select * from book where bookid like % & text1.tex

41、t & %if querydata(strf) then text2.text = rst.fields(bookname).value text3.text = rst.fields(booktype).value text4.text = rst.fields(bookprice).value text5.text = rst.fields(bookstate).value text6.text = rst.fields(bookpublish).value text7.text = rst.fields(bookintime).valueend ifend subprivate sub

42、form_load() call txtclsend subprivate sub upd2() rst.fields(0).value = text1.text rst.fields(1).value = text2.text rst.fields(2).value = text3.text rst.fields(3).value = text4.text rst.fields(4).value = text5.text rst.fields(5).value = text6.text rst.fields(6).value = text7.textend subprivate sub tx

43、tcls() text1.text = text2.text = text3.text = text4.text = text5.text = text6.text = text7.text = end subprivate sub showdb() text1.text = rst.fields(0).value text2.text = rst.fields(1).value text3.text = rst.fields(2).value text4.text = rst.fields(3).value text5.text = rst.fields(4).value text6.tex

44、t = rst.fields(5).value text7.text = rst.fields(6).valueend sub當(dāng)單擊數(shù)據(jù)管理刪除刪除讀者菜單時(shí),窗體如下代碼如下:private sub command1_click()unload meend subprivate sub command2_click() if rst.eof = true and rst.bof = true then msgbox 沒(méi)有數(shù)據(jù)! else rst.delete rst.movefirst if rst.bof or rst.eof then msgbox 沒(méi)有數(shù)據(jù) call txtcls en

45、d if call showdb end ifend subprivate sub command3_click()unload meend subprivate sub command5_click()dim strf1 as string strf1 = select * from reader where readerid like % & text1.text & % if querydata(strf1) then text2.text = rst.fields(readername).value text3.text = rst.fields(readerage).value te

46、xt4.text = rst.fields(readercity).value text5.text = rst.fields(email).value end ifend subprivate sub form_load()txtclsend subprivate sub txtcls() text1.text = text2.text = text3.text = text4.text = text5.text = end subprivate sub showdb() text1.text = rst.fields(0).value text2.text = rst.fields(1).

47、value text3.text = rst.fields(2).value text4.text = rst.fields(3).value text5.text = rst.fields(4).value end sub當(dāng)單擊記錄瀏覽讀者記錄菜單時(shí),窗體如下代碼如下:private sub command1_click()dim strf as stringif combo1.text = 編號(hào) then strf = select * from reader where readerid like % & text1.text & %if querydata(strf) then set datagrid1.datasource = rstend ifend ifif

溫馨提示

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

最新文檔

評(píng)論

0/150

提交評(píng)論