《數(shù)據(jù)庫原理》課程設(shè)計(jì)報(bào)告農(nóng)產(chǎn)品信息管理系統(tǒng)

上傳人:仙*** 文檔編號(hào):27836073 上傳時(shí)間:2021-08-21 格式:DOC 頁數(shù):46 大?。?93KB
收藏 版權(quán)申訴 舉報(bào) 下載
《數(shù)據(jù)庫原理》課程設(shè)計(jì)報(bào)告農(nóng)產(chǎn)品信息管理系統(tǒng)_第1頁
第1頁 / 共46頁
《數(shù)據(jù)庫原理》課程設(shè)計(jì)報(bào)告農(nóng)產(chǎn)品信息管理系統(tǒng)_第2頁
第2頁 / 共46頁
《數(shù)據(jù)庫原理》課程設(shè)計(jì)報(bào)告農(nóng)產(chǎn)品信息管理系統(tǒng)_第3頁
第3頁 / 共46頁

下載文檔到電腦,查找使用更方便

15 積分

下載資源

還剩頁未讀,繼續(xù)閱讀

資源描述:

《《數(shù)據(jù)庫原理》課程設(shè)計(jì)報(bào)告農(nóng)產(chǎn)品信息管理系統(tǒng)》由會(huì)員分享,可在線閱讀,更多相關(guān)《《數(shù)據(jù)庫原理》課程設(shè)計(jì)報(bào)告農(nóng)產(chǎn)品信息管理系統(tǒng)(46頁珍藏版)》請(qǐng)?jiān)谘b配圖網(wǎng)上搜索。

1、 數(shù)據(jù)庫原理課程設(shè)計(jì)報(bào)告 農(nóng)產(chǎn)品信息管理系統(tǒng)系 部: 計(jì)算機(jī)與信息科學(xué)系 學(xué)生姓名: 指導(dǎo)教師: 專 業(yè): 計(jì)算機(jī)與信息科學(xué) 班 級(jí): 信本0902班 完成時(shí)間: 2011年6月15日 目 錄1 引 言12 設(shè)計(jì)目的與任務(wù)23 數(shù)據(jù)庫設(shè)計(jì)33.1 需求分析33.1.1 數(shù)據(jù)需求33.1.2 數(shù)據(jù)字典43.2 概念設(shè)計(jì)63.2.1 實(shí)體集63.2.2 E-R圖73.2.3 概念模型73.3 邏輯設(shè)計(jì)83.3.1 物理模型83.3.2 關(guān)系模型93.4 數(shù)據(jù)庫實(shí)現(xiàn)103.4.1建立數(shù)據(jù)庫模式及視圖103.4.2源代碼124 結(jié) 論405 致 謝416 參考文獻(xiàn)427 附 錄431 引 言隨著計(jì)算機(jī)

2、行業(yè)的興起,信息管理技術(shù)在現(xiàn)實(shí)生活中得到了越來越廣泛的應(yīng)用,信息管理系統(tǒng)的實(shí)施在技術(shù)上已逐步成熟。信息管理系統(tǒng)是一個(gè)不斷發(fā)展的新型學(xué)科,任何一個(gè)單位要生存要發(fā)展,要高效率地把內(nèi)部活動(dòng)有機(jī)地組織起來,就必須建立與自身特點(diǎn)相適應(yīng)的管理系統(tǒng)。對(duì)于農(nóng)產(chǎn)品生產(chǎn)機(jī)構(gòu)而言,能有一個(gè)完善的農(nóng)產(chǎn)品信息的管理系統(tǒng)來方便快捷的完成對(duì)農(nóng)產(chǎn)品信息和倉庫管理員信息的查詢、修改和管理,在提高管理效率和查找農(nóng)產(chǎn)品信息效率上是不可缺少的。對(duì)于我們而言,通過完成每期的課程設(shè)計(jì),不但可以不斷的提升自己的動(dòng)手能力,加強(qiáng)的我們的團(tuán)隊(duì)合作精神,培養(yǎng)我們敏捷的思維能力。還可以提升我們對(duì)專業(yè)認(rèn)識(shí),更好的理解和掌握我們的專業(yè)知識(shí)。2 設(shè)計(jì)目的

3、與任務(wù)通過本次課程設(shè)計(jì),學(xué)習(xí)數(shù)據(jù)庫設(shè)計(jì)工具的使用,掌握數(shù)據(jù)庫設(shè)計(jì)的流程和基本方法。熟練VB與數(shù)據(jù)庫之間的鏈接,完成對(duì)某一小型數(shù)據(jù)庫設(shè)計(jì)和相應(yīng)文檔的編寫工作。從而更加深入地掌握數(shù)據(jù)庫系統(tǒng)分析與設(shè)計(jì)的基本概念和基本方法,提高從事數(shù)據(jù)庫系統(tǒng)建設(shè)和管理工作的基本技能和能力。本課程設(shè)計(jì)要求設(shè)計(jì)一個(gè)農(nóng)產(chǎn)品信息管理系統(tǒng),能對(duì)數(shù)據(jù)庫中的農(nóng)產(chǎn)品信息隨時(shí)進(jìn)行新增、修改和刪除。數(shù)據(jù)庫中包含農(nóng)產(chǎn)品信息表,職員信息表和倉庫信息表和用戶表。同時(shí)創(chuàng)建基本視圖,實(shí)現(xiàn)對(duì)數(shù)據(jù)的查詢、新增、修改和刪除。用戶登錄需驗(yàn)證用戶的身份,對(duì)于不合權(quán)限的用戶,拒絕其登錄本系統(tǒng)。3 數(shù)據(jù)庫設(shè)計(jì)3.1 需求分析3.1.1 數(shù)據(jù)需求通過與農(nóng)產(chǎn)品信息

4、管理系統(tǒng)數(shù)據(jù)庫用戶的交談、團(tuán)隊(duì)的分析、市場(chǎng)需求等方式,獲得了農(nóng)產(chǎn)品信息管理系統(tǒng)的數(shù)據(jù)需求。有多個(gè)用戶可以訪問該數(shù)據(jù)庫,為了數(shù)據(jù)庫的安全,對(duì)于每個(gè)用戶登錄前都需通過身份認(rèn)證,認(rèn)證通過后方能進(jìn)入該系統(tǒng)。一個(gè)農(nóng)產(chǎn)品公司可生產(chǎn)多種農(nóng)產(chǎn)品,不同農(nóng)產(chǎn)品存放在不同的倉庫,每個(gè)倉庫有固定的管理員。每個(gè)農(nóng)產(chǎn)品信息包含產(chǎn)品編號(hào)、倉庫號(hào)、產(chǎn)品名、入庫時(shí)間、庫存量和總值。每個(gè)倉庫信息包含倉庫號(hào)、面積和電話號(hào)碼。每位管理員信息包括管理員號(hào)、姓名、性別、出生年月和聯(lián)系方式。圖3.11農(nóng)產(chǎn)品信息管理系統(tǒng)數(shù)據(jù)流圖3.1.2 數(shù)據(jù)字典 以下將對(duì)本數(shù)據(jù)庫設(shè)計(jì)中的各個(gè)數(shù)據(jù)表名稱進(jìn)行解釋。表3.1農(nóng)產(chǎn)品信息管理清單表名解釋農(nóng)產(chǎn)品信息

5、表用來記錄農(nóng)產(chǎn)品的相關(guān)信息用戶用來記錄登錄用戶的用戶名和密碼職員表用來記錄管理員的相關(guān)信息倉庫信息表用來記錄倉庫里農(nóng)產(chǎn)品的相關(guān)信息表3.2農(nóng)產(chǎn)品信息表農(nóng)產(chǎn)品信息表是否主鍵屬性名數(shù)據(jù)類型長(zhǎng)度可 空約 束缺省值備 注是產(chǎn)品編號(hào)Char(10)10倉庫號(hào)Char(10)10產(chǎn)品名Char(10)10入庫時(shí)間Char(20)10庫存量Char(10)20總 值 Char(10)10表3.3用戶信息表用戶是否主鍵屬性名數(shù)據(jù)類型長(zhǎng)度可空約 束缺省值備 注是用戶名Char(10)10密碼Char(20)20表3.4職員信息表職員信息表是否主鍵屬性名數(shù)據(jù)類型長(zhǎng)度可空約 束缺省值備 注是管理員號(hào)Char(10)

6、10姓名Char(10)10性別Char(2)2出生年月Char(40)40聯(lián)系方式Char(14)14表3.5倉庫信息表倉庫信息表是否主鍵屬性名數(shù)據(jù)類型長(zhǎng)度可 空約 束缺省值備 注是倉庫號(hào)Char(10)10面 積Char(20)10電話號(hào)碼Char(14)103.2 概念設(shè)計(jì)3.2.1 實(shí)體集 本數(shù)據(jù)庫E-R圖設(shè)計(jì)中包含4個(gè)實(shí)體,其中4個(gè)實(shí)體都是強(qiáng)實(shí)體集。實(shí)體的具體屬性可見下表。表3.6農(nóng)產(chǎn)品信息管理系統(tǒng)實(shí)體集農(nóng)產(chǎn)品信息管理系統(tǒng)實(shí)體集實(shí)體集屬性農(nóng)產(chǎn)品信息表產(chǎn)品編號(hào)、倉庫號(hào)、產(chǎn)品名、入庫時(shí)間、庫存量、總值職員信息表管理員號(hào)、姓名、性別、出生年月、聯(lián)系方式倉庫信息表倉庫號(hào)、面積、電話號(hào)碼用戶用

7、戶名、密碼3.2.2 E-R圖圖3.22 農(nóng)產(chǎn)品信息管理系統(tǒng)數(shù)據(jù)庫E-R圖3.2.3 概念模型由圖3.1的E-R圖中實(shí)體之間的聯(lián)系,利用powerdesigner工具概念模型。最終概念模型圖如圖2所示圖3.23農(nóng)產(chǎn)品信息管理系統(tǒng)數(shù)據(jù)庫概念模型 3.3 邏輯設(shè)計(jì)3.3.1 物理模型根據(jù)圖3.2的概念模型圖,可以利用powerdesigner導(dǎo)出農(nóng)產(chǎn)品管理系統(tǒng)數(shù)據(jù)庫的物理模型圖。圖3.31農(nóng)產(chǎn)品信息管理系統(tǒng)數(shù)據(jù)庫物理模型3.3.2 關(guān)系模型根據(jù)關(guān)系模式轉(zhuǎn)換規(guī)則,把圖1E-R圖轉(zhuǎn)換為關(guān)系模式,如下所示(有實(shí)下劃線的為主碼):農(nóng)產(chǎn)品信息=(產(chǎn)品編號(hào),倉庫號(hào),產(chǎn)品名,入庫時(shí)間,庫存量,總值)倉庫信息=(

8、倉庫號(hào),面積,電話號(hào)碼)職員信息=(管理員號(hào),姓名,性別,出生年月,聯(lián)系方式)用戶=(用戶名,密碼)管理=(倉庫號(hào),管理員號(hào))3.4 數(shù)據(jù)庫實(shí)現(xiàn)3.4.1建立數(shù)據(jù)庫模式及視圖 以下將對(duì)數(shù)據(jù)庫進(jìn)行實(shí)現(xiàn),實(shí)現(xiàn)的環(huán)境為SQLSERVER2008。create database 農(nóng)產(chǎn)品信息管理on primary( Name=農(nóng)產(chǎn)品信息管理_data, Filename= D:數(shù)據(jù)庫課程設(shè)計(jì)農(nóng)產(chǎn)品信息.mdf , size=10, Filegrowth=10%, maxsize=unlimited )log on( Name=農(nóng)產(chǎn)品信息管理_log, Filename=D: 數(shù)據(jù)庫課程設(shè)計(jì)農(nóng)產(chǎn)品信息.

9、ldf, size=1, Filegrowth=10%, maxsize=5)1.建立農(nóng)產(chǎn)品信息表CREATE TABLE 農(nóng)產(chǎn)品信息表 ( 產(chǎn)品編號(hào) CHAR(10) PRIMARY KEY ,倉庫號(hào) CHAR(10) 產(chǎn)品名 CHAR(10),入庫時(shí)間 char(10) NOT NULL,庫存量CHAR(10)總 值CHAR(10)2.倉庫信息表CREATE TABLE 倉庫信息表( 倉庫號(hào) CHAR(10) PRIMARY KEY ,面 積 CHAR(10) NOT NULL,電話號(hào)碼 CHAR(10),)3.職員信息表CREATE TABLE 職員信息表( 管理員號(hào)CHAR(10) P

10、RIMARY KEY ,姓 名 CHAR(10),性 別 CHAR(10),出生年月 CHAR(10),聯(lián)系方式CHAR(10),)4.用戶CREATE TABLE 用戶( 用戶名 CHAR(10) PRIMARY KEY ,密 碼 CHAR(30)*新建視圖*建立農(nóng)產(chǎn)品信息視圖CREATE VIEW 農(nóng)產(chǎn)品信息(產(chǎn)品編號(hào),倉庫號(hào),入庫時(shí)間,庫存量,總值)ASSELECT 產(chǎn)品編號(hào),倉庫號(hào),入庫時(shí)間,庫存量,總值FROM 農(nóng)產(chǎn)品信息表建立倉庫信息視圖CREATE VIEW 倉庫信息(倉庫號(hào),面積,電話號(hào)碼)ASSELECT 倉庫號(hào),面積,電話號(hào)碼FROM 倉庫信息表建立職員信息CREATE V

11、IEW 職員信息(管理員號(hào),姓名,性別,出生年月,聯(lián)系方式)ASSELECT 管理員號(hào),姓名,性別,出生年月,聯(lián)系方式FROM 管理員信息表3.4.2源代碼用戶登錄Private Sub Command1_Click() Adodc1.Recordset.MoveFirst Adodc1.Recordset.Find 用戶名= & Text1.Text & SQL = SELECT 用戶名 FROM 用戶 WHREE 用戶名 LIKE Text1.Text Adodc1.RecordSource = SQL Static i As Integer If Adodc1.Recordset.EOF

12、 And i 3 Then MsgBox 用戶名錯(cuò)誤,請(qǐng)重新輸入!, 32, 提示信息 i = i + 1 Text1.Text = Text1.SetFocus Exit Sub End If Adodc1.Recordset.MoveFirst Adodc1.Recordset.Find 密碼= & Text2.Text & SQL = SELECT 密碼 FROM 用戶 WHREE 用戶名 LIKE Text1.Text Adodc1.RecordSource = SQL If Adodc1.Recordset.EOF And i 3 Then MsgBox 密碼錯(cuò)誤,請(qǐng)重新輸入!, 3

13、2, 提示信息 i = i + 1 Text2.Text = Text2.SetFocus Exit Sub End If If i = 3 Then MsgBox 請(qǐng)不起,您無權(quán)登錄本系統(tǒng)!, 16, 提示信息 Form3.Show Form2.Hide Exit Sub End If Form5.Show Form2.Hide Text1.Text = Text2.Text = End SubPrivate Sub Text2_KeyUp(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then Adodc1.Recordset.

14、MoveFirst Adodc1.Recordset.Find 用戶名= & Text1.Text & SQL = SELECT 用戶名 FROM 用戶 WHREE 用戶名 LIKE Text1.Text Adodc1.RecordSource = SQL Static i As Integer If Adodc1.Recordset.EOF And i 3 Then MsgBox 用戶名錯(cuò)誤,請(qǐng)重新輸入!, 32, 提示信息 i = i + 1 Text1.Text = Text1.SetFocus Exit Sub End If Adodc1.Recordset.MoveFirst Ado

15、dc1.Recordset.Find 密碼= & Text2.Text & SQL = SELECT 密碼 FROM 用戶 WHREE 用戶名 LIKE Text1.Text Adodc1.RecordSource = SQL If Adodc1.Recordset.EOF And i 3 Then MsgBox 密碼錯(cuò)誤,請(qǐng)重新輸入!, 32, 提示信息 i = i + 1 Text2.Text = Text2.SetFocus Exit Sub End If If i = 3 Then MsgBox 請(qǐng)不起,您無權(quán)登錄本系統(tǒng)!, 16, 提示信息 Form3.Show Form2.Hide

16、 Exit Sub End If Form5.Show Form2.Hide Text1.Text = Text2.Text = End IfEnd Sub密碼修改Private Sub Command1_Click() If Text2.Text Text3.Text Then MsgBox 兩次新密碼輸入不一致,請(qǐng)重新輸入!, 32, 提示信息 Text2.Text = Text3.Text = Text2.SetFocus Exit Sub End If If KeyCode = 13 And Text2.Text = Text3.Text Then Adodc1.Recordset.M

17、oveFirst Adodc1.Recordset.Find 用戶名= & Text4.Text & SQL = SELECT 用戶名 FROM 用戶 WHREE 用戶名 LIKE Text4.Text Adodc1.RecordSource = SQL Adodc1.Recordset(用戶名) = Trim$(Text4.Text) Adodc1.Recordset(密碼) = Trim$(Text2.Text) Adodc1.Recordset.Update MsgBox 密碼修改成功!, vbInformation Text1.Text = Text2.Text = Text3.Tex

18、t = Text4.Text = Exit Sub End IfEnd SubPrivate Sub Text1_KeyUp(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then Adodc1.Recordset.MoveFirst Adodc1.Recordset.Find 密碼= & Text1.Text & SQL = SELECT 密碼 FROM 用戶 WHREE 用戶名 LIKE Text4.Text Adodc1.RecordSource = SQL If Adodc1.Recordset.EOF And i 3 Th

19、en MsgBox 舊密碼密碼輸入錯(cuò)誤,請(qǐng)重新輸入!, 32, 提示信息 i = i + 1 Text1.Text = Text1.SetFocus Exit Sub End If If i = 3 Then MsgBox 請(qǐng)不起,您無權(quán)修改本用戶密碼!, 16, 提示信息 Form2.Show Form4.Hide Exit Sub End If Text2.SetFocus End IfEnd SubPrivate Sub Text3_KeyUp(KeyCode As Integer, Shift As Integer) If KeyCode = 13 And Text2.Text Tex

20、t3.Text Then MsgBox 兩次新密碼輸入不一致,請(qǐng)重新輸入!, 32, 提示信息 Text2.Text = Text3.Text = Text2.SetFocus Exit Sub End If If KeyCode = 13 And Text2.Text = Text3.Text Then Adodc1.Recordset.MoveFirst Adodc1.Recordset.Find 用戶名= & Text4.Text & SQL = SELECT 用戶名 FROM 用戶 WHREE 用戶名 LIKE Text4.Text Adodc1.RecordSource = SQL

21、Adodc1.Recordset(用戶名) = Trim$(Text4.Text) Adodc1.Recordset(密碼) = Trim$(Text2.Text) Adodc1.Recordset.Update MsgBox 密碼修改成功!, vbInformation Text1.Text = Text2.Text = Text3.Text = Text4.Text = Exit Sub End IfEnd SubPrivate Sub Text4_KeyUp(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then Adodc1

22、.Recordset.MoveFirst Adodc1.Recordset.Find 用戶名= & Text4.Text & SQL = SELECT 用戶名 FROM 用戶 WHREE 用戶名 LIKE Text4.Text Adodc1.RecordSource = SQL Static i As Integer If Adodc1.Recordset.EOF Then MsgBox 用戶名輸入錯(cuò)誤,請(qǐng)重新輸入!, 32, 提示信息 Text4.Text = Text4.SetFocus Exit Sub End If Text1.SetFocus End IfEnd Sub農(nóng)產(chǎn)品信息查詢

23、Private Sub Command1_Click() Adodc1.Recordset.MoveFirst Adodc1.Recordset.Find 產(chǎn)品名= & Text1.Text & SQL = SELECT 產(chǎn)品名 FROM 農(nóng)產(chǎn)品信息表 WHREE 產(chǎn)品名 LIKE Text1.Text Adodc1.RecordSource = SQL If Adodc1.Recordset.EOF Then MsgBox 請(qǐng)不起,暫時(shí)還沒有您要查找的信息!, 32, 提示信息 Text1.Text = Text1.SetFocus Exit Sub End If Text2.Text =

24、Adodc1.Recordset(產(chǎn)品編號(hào)) Text3.Text = Adodc1.Recordset(倉庫號(hào)) Text4.Text = Adodc1.Recordset(產(chǎn)品名) Text5.Text = Adodc1.Recordset(入庫時(shí)間) Text6.Text = Adodc1.Recordset(庫存量) Text7.Text = Adodc1.Recordset(總值)End SubPrivate Sub Command6_Click() Dim i As Integer i = MsgBox(確定要?jiǎng)h除當(dāng)前記錄嗎?, 4 + 48, 警告) If i = vbYes T

25、hen Adodc1.Recordset.Delete Adodc1.Recordset.MoveNext Text1.Text = Text2.Text = Text3.Text = Text4.Text = Text5.Text = Text6.Text = Text7.Text = MsgBox 刪除成功!, vbInformation, 提示信息 End IfEnd SubPrivate Sub Text1_KeyUp(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then Adodc1.Recordset.MoveFirs

26、t Adodc1.Recordset.Find 產(chǎn)品名= & Text1.Text & SQL = SELECT 產(chǎn)品名 FROM 農(nóng)產(chǎn)品信息表 WHREE 產(chǎn)品名 LIKE Text1.Text Adodc1.RecordSource = SQL If Adodc1.Recordset.EOF Then MsgBox 請(qǐng)不起,暫時(shí)還沒有您要查找的信息!, 32, 提示信息 Text1.Text = Text1.SetFocus Exit Sub End If Text2.Text = Adodc1.Recordset(產(chǎn)品編號(hào)) Text3.Text = Adodc1.Recordset(倉

27、庫號(hào)) Text4.Text = Adodc1.Recordset(產(chǎn)品名) Text5.Text = Adodc1.Recordset(入庫時(shí)間) Text6.Text = Adodc1.Recordset(庫存量) Text7.Text = Adodc1.Recordset(總值) End IfEnd Sub倉庫信息查詢Private Sub Command1_Click() Adodc1.Recordset.MoveFirst Adodc1.Recordset.Find 倉庫號(hào)= & Text1.Text & SQL = SELECT 倉庫號(hào) FROM 倉庫信息表 WHREE 倉庫號(hào) L

28、IKE Text1.Text Adodc1.RecordSource = SQL If Adodc1.Recordset.EOF Then MsgBox 請(qǐng)不起,暫時(shí)還沒有您要查找的信息!, 32, 提示信息 Text1.Text = Text1.SetFocus Exit Sub End If Text2.Text = Adodc1.Recordset(倉庫號(hào)) Text3.Text = Adodc1.Recordset(面積) Text7.Text = Adodc1.Recordset(電話號(hào)碼)End SubPrivate Sub Command4_Click() Dim i As In

29、teger i = MsgBox(確定要?jiǎng)h除當(dāng)前記錄嗎?, 4 + 48, 警告) If i = vbYes Then Adodc1.Recordset.Delete Adodc1.Recordset.MoveNext Text1.Text = Text2.Text = Text3.Text = Text7.Text = MsgBox 刪除成功!, vbInformation, 提示信息 End IfEnd SubPrivate Sub Text1_KeyUp(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then Adodc1.R

30、ecordset.MoveFirst Adodc1.Recordset.Find 倉庫號(hào)= & Text1.Text & SQL = SELECT 倉庫號(hào) FROM 倉庫信息表 WHREE 倉庫號(hào) LIKE Text1.Text Adodc1.RecordSource = SQL If Adodc1.Recordset.EOF Then MsgBox 請(qǐng)不起,暫時(shí)還沒有您要查找的信息!, 32, 提示信息 Text1.Text = Text1.SetFocus Exit Sub End If Text2.Text = Adodc1.Recordset(倉庫號(hào)) Text3.Text = Ado

31、dc1.Recordset(面積) Text7.Text = Adodc1.Recordset(電話號(hào)碼) End IfEnd Sub職員信息查詢Private Sub Command1_Click() Adodc1.Recordset.MoveFirst Adodc1.Recordset.Find 姓名= & Text1.Text & SQL = SELECT 姓名 FROM 職員信息表 WHREE 姓名 LIKE Text1.Text Adodc1.RecordSource = SQL If Adodc1.Recordset.EOF Then MsgBox 請(qǐng)不起,暫時(shí)還沒有您要查找的信息

32、!, 32, 提示信息 Text1.Text = Text1.SetFocus Exit Sub End If Text2.Text = Adodc1.Recordset(管理員號(hào)) Text3.Text = Adodc1.Recordset(姓名) Text4.Text = Adodc1.Recordset(性別) Text5.Text = Adodc1.Recordset(出生年月) Text6.Text = Adodc1.Recordset(聯(lián)系方式)End SubPrivate Sub Command6_Click() Dim i As Integer i = MsgBox(確定要?jiǎng)h除

33、當(dāng)前記錄嗎?, 4 + 48, 警告) If i = vbYes Then Adodc1.Recordset.Delete Text1.Text = Text2.Text = Text3.Text = Text4.Text = Text5.Text = Text6.Text = MsgBox 刪除成功!, vbInformation, 提示信息 End IfEnd SubPrivate Sub Text1_KeyUp(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then Adodc1.Recordset.MoveFirst Ado

34、dc1.Recordset.Find 姓名= & Text1.Text & SQL = SELECT 姓名 FROM 職員信息表 WHREE 姓名 LIKE Text1.Text Adodc1.RecordSource = SQL If Adodc1.Recordset.EOF Then MsgBox 請(qǐng)不起,暫時(shí)還沒有您要查找的信息!, 32, 提示信息 Text1.Text = Text1.SetFocus Exit Sub End If Text2.Text = Adodc1.Recordset(管理員號(hào)) Text3.Text = Adodc1.Recordset(姓名) Text4.

35、Text = Adodc1.Recordset(性別) Text5.Text = Adodc1.Recordset(出生年月) Text6.Text = Adodc1.Recordset(聯(lián)系方式) End IfEnd Sub新增農(nóng)產(chǎn)品信息Private Sub Command2_Click() If Text1.Text = Then MsgBox 請(qǐng)輸入農(nóng)產(chǎn)品編名!, vbExclamation Text1.SetFocus Exit Sub End If If Text2.Text = Then MsgBox 請(qǐng)輸入農(nóng)產(chǎn)品名!, vbExclamation Text2.SetFocus

36、Exit Sub End If If Text3.Text = Then MsgBox 請(qǐng)輸入農(nóng)產(chǎn)品入庫號(hào)!, vbExclamation Text3.SetFocus Exit Sub End If Adodc1.Refresh Adodc1.Recordset.Find (產(chǎn)品編號(hào)= & Text1.Text & ) If Not Adodc1.Recordset.EOF Then MsgBox 產(chǎn)品號(hào)重復(fù),請(qǐng)重新輸入!, vbExclamation Text1.SetFocus Exit Sub End If Adodc1.Recordset.Find (產(chǎn)品名= & Text3.Tex

37、t & ) If Not Adodc1.Recordset.EOF Then MsgBox 產(chǎn)品名重復(fù),請(qǐng)重新輸入!, vbExclamation Text2.SetFocus Exit Sub Else Adodc1.Recordset.AddNew Adodc1.Recordset.Fields(0) = Trim$(Text1.Text) Adodc1.Recordset.Fields(1) = Trim$(Text2.Text) Adodc1.Recordset.Fields(2) = Trim$(Text3.Text) Adodc1.Recordset.Fields(3) = Tri

38、m$(Text4.Text) Adodc1.Recordset.Fields(4) = Trim$(Text5.Text) Adodc1.Recordset.Fields(5) = Trim$(Text6.Text) Adodc1.Recordset.Update MsgBox 農(nóng)產(chǎn)品信息已經(jīng)添加成功!, vbInformation Adodc1.Refresh Text1.Text = Text2.Text = Text3.Text = Text4.Text = Text5.Text = Text6.Text = End IfEnd SubPrivate Sub Text6_Change()

39、 If KeyCode = 13 Then If Text1.Text = Then MsgBox 請(qǐng)輸入農(nóng)產(chǎn)品編名!, vbExclamation Text1.SetFocus Exit Sub End If If Text2.Text = Then MsgBox 請(qǐng)輸入農(nóng)產(chǎn)品名!, vbExclamation Text2.SetFocus Exit Sub End If If Text3.Text = Then MsgBox 請(qǐng)輸入農(nóng)產(chǎn)品入庫號(hào)!, vbExclamation Text3.SetFocus Exit Sub End If Adodc1.Refresh Adodc1.Reco

40、rdset.Find (產(chǎn)品編號(hào)= & Text1.Text & ) If Not Adodc1.Recordset.EOF Then MsgBox 產(chǎn)品號(hào)重復(fù),請(qǐng)重新輸入!, vbExclamation Text1.SetFocus Exit Sub End If Adodc1.Recordset.Find (產(chǎn)品名= & Text3.Text & ) If Not Adodc1.Recordset.EOF Then MsgBox 產(chǎn)品名重復(fù),請(qǐng)重新輸入!, vbExclamation ext2.SetFocus Exit Sub Else Adodc1.Recordset.AddNew A

41、dodc1.Recordset.Fields(0) = Trim$(Text1.Text) Adodc1.Recordset.Fields(1) = Trim$(Text2.Text) Adodc1.Recordset.Fields(2) = Trim$(Text3.Text) Adodc1.Recordset.Fields(3) = Trim$(Text4.Text) Adodc1.Recordset.Fields(4) = Trim$(Text5.Text) Adodc1.Recordset.Fields(5) = Trim$(Text6.Text) Adodc1.Recordset.Up

42、date MsgBox 農(nóng)產(chǎn)品信息已經(jīng)添加成功!, vbInformation Adodc1.Refresh Text1.Text = Text2.Text = Text3.Text = Text4.Text = Text5.Text = Text6.Text = End If End IfEnd Sub新增倉庫信息Private Sub Command1_Click() If Text1.Text = Then MsgBox 請(qǐng)輸入倉庫號(hào)!, vbExclamation Text1.SetFocus Exit Sub End If If Text2.Text = Then MsgBox 請(qǐng)輸

43、入面積!, vbExclamation Text2.SetFocus Exit Sub End If Adodc1.Refresh Adodc1.Recordset.Find (倉庫號(hào)= & Text1.Text & ) If Not Adodc1.Recordset.EOF Then MsgBox 倉庫號(hào)重復(fù),請(qǐng)重新輸入!, vbExclamation Text1.SetFocus Exit Sub Else Adodc1.Recordset.AddNew Adodc1.Recordset.Fields(0) = Trim$(Text1.Text) Adodc1.Recordset.Fiel

44、ds(1) = Trim$(Text2.Text) Adodc1.Recordset.Fields(2) = Trim$(Text3.Text) Adodc1.Recordset.Update MsgBox 倉庫信息已經(jīng)添加成功!, vbInformation Text1.Text = Text2.Text = Text3.Text = End IfEnd Sub新增職員信息Private Sub Command1_Click() If Text1.Text = Then MsgBox 請(qǐng)輸入管理員號(hào)!, vbExclamation Text1.SetFocus Exit Sub End If

45、 If Text2.Text = Then MsgBox 請(qǐng)輸入管理員姓名!, vbExclamation Text3.SetFocus Exit Sub End If Adodc1.Refresh Adodc1.Recordset.Find (管理員號(hào)= & Text1.Text & ) If Not Adodc1.Recordset.EOF Then MsgBox 管理員號(hào)重復(fù),請(qǐng)重新輸入!, vbExclamation Text1.SetFocus Exit Sub Else Adodc1.Recordset.AddNew Adodc1.Recordset.Fields(0) = Tri

46、m$(Text1.Text) Adodc1.Recordset.Fields(1) = Trim$(Text2.Text) Adodc1.Recordset.Fields(2) = Trim$(Text3.Text) Adodc1.Recordset.Fields(3) = Trim$(Text4.Text) Adodc1.Recordset.Fields(4) = Trim$(Text5.Text) Adodc1.Recordset.Update MsgBox 管理員信息添加成功!, vbInformation Text1.Text = Text2.Text = Text3.Text = T

47、ext4.Text = Text5.Text = End IfEnd SubPrivate Sub Command2_Click() Text1.Text = Text2.Text = Text3.Text = Text4.Text = Text5.Text = End SubPrivate Sub Text5_Change() If KeyCode = 13 Then If Text1.Text = Then MsgBox 請(qǐng)輸入管理員號(hào)!, vbExclamation Text1.SetFocus Exit Sub End If If Text2.Text = Then MsgBox 請(qǐng)輸入管理員姓名!, vbExclamation Text3.SetFocus Exit Sub End If Adodc1.Refresh Adodc1.Recordset.Find (管理員號(hào)= & Text1.Text & ) If Not Adodc1.Re

展開閱讀全文
溫馨提示:
1: 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
2: 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
3.本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
5. 裝配圖網(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ì)自己和他人造成任何形式的傷害或損失。

相關(guān)資源

更多
正為您匹配相似的精品文檔
關(guān)于我們 - 網(wǎng)站聲明 - 網(wǎng)站地圖 - 資源地圖 - 友情鏈接 - 網(wǎng)站客服 - 聯(lián)系我們

copyright@ 2023-2025  zhuangpeitu.com 裝配圖網(wǎng)版權(quán)所有   聯(lián)系電話:18123376007

備案號(hào):ICP2024067431號(hào)-1 川公網(wǎng)安備51140202000466號(hào)


本站為文檔C2C交易模式,即用戶上傳的文檔直接被用戶下載,本站只是中間服務(wù)平臺(tái),本站所有文檔下載所得的收益歸上傳人(含作者)所有。裝配圖網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)上載內(nèi)容本身不做任何修改或編輯。若文檔所含內(nèi)容侵犯了您的版權(quán)或隱私,請(qǐng)立即通知裝配圖網(wǎng),我們立即給予刪除!