【正文】
放入一個(gè)數(shù)據(jù)控件data1, 其屬性與結(jié)構(gòu)設(shè)置和前面類似,省略3. 在窗體中放入三個(gè)文本框控件,其屬性如下:對(duì)象名稱屬性項(xiàng)名屬性設(shè)置內(nèi)容Text1DatasourceData1datafield房號(hào)Text2DatasourceData1datafield客房級(jí)別Text3DatasourceData1datafield用房標(biāo)記代碼如下:Private Sub Command1_Click()On Error Resume Next = False = TrueText1(0).SetFocusEnd SubPrivate Sub mand2_Click()If Text1(0).Text = Or = Or Text1(2).Text = Then MsgBox 請(qǐng)輸入數(shù)據(jù) = True Text1(0).SetFocus Exit SubEnd If = TrueEnd SubPrivate Sub Command3_Click()If Text1(0).Text = Or = Or Text1(2).Text = ThenMsgBox 請(qǐng)輸入數(shù)據(jù) = False = TrueText1(0).SetFocusExit SubEnd If = FalseEnd SubPrivate Sub Command4_Click()Dim msgDim oldmarkoldmark = msg = Trim(InputBox(請(qǐng)輸入房號(hào), 查詢))msg = 房號(hào) like 39。 msg amp。 msgIf Then MsgBox (沒(méi)有符合條件的房間,請(qǐng)重新輸入) = True Exit SubElse msg = 用戶標(biāo)志 like 39。 1 amp。 msg If Then MsgBox (沒(méi)有符合條件的房間,請(qǐng)重新輸入) = True End If End IfEnd SubPrivate Sub Command5_Click() Text1(2).Text = End SubPrivate Sub Command6_Click() Unload MeEnd SubPrivate Sub Data1_Error(DataErr As Integer, Response As Integer)39。如果想忽略錯(cuò)誤,注釋掉下一行代碼39。 Error$(DataErr)Response = 0 39。 ( + 1)End SubPrivate Sub Form_Load() = amp。 amp。 39。 amp。 39。 amp。 39。 amp。 39。 amp。 39。 amp。 39。 amp。 39。 amp。 39。 amp。 39。 amp。 39。這就是放置錯(cuò)誤處理代碼的地方39。如果想捕捉錯(cuò)誤,在這里添加錯(cuò)誤處理代碼MsgBox 數(shù)據(jù)錯(cuò)事件命中錯(cuò)誤: amp。忽略錯(cuò)誤End SubPrivate Sub Data1_Reposition() = 記錄: amp。 \End Sub Summary : The 21st century is a kownledge economy , information explosion is a characteristic in this , managements and usings of informations are putting forward higher demand to enterprises in information age, This reflects it in two aspects mainly, firstly,The world that we are in bee ocean , knowledge of information already, Enterprises must possess and obtain , deal with and use the ability of the information from the environment of an enterprise, secondly,Enterprise must have been managing and using enterprise’s data information that reflects enterprise of states,witch it produces constantly itself and that describes control letters of management activity to possess also, Having no need for reticence, Visual Basic is a kind of puter language with the fastest developing speed in recent years, Its is favored by numerous puters and programmers with practicabilities succinctly. The ones that pass through Microsoft dealling in generality, Setting up the ability that windows uses conveniently for this language, Thus offered and developed many tasks and high performances that various kinds of business system’s needs.參考文獻(xiàn):《信息系統(tǒng)開(kāi)發(fā)方法教程》 清華大學(xué)出版社 陳佳 編著《中文Access2002》實(shí)用教程》 電子工業(yè)出版社 趙增敏等 編著《Visual Basic 實(shí)用培訓(xùn)教程》 人民郵電出版社 金英姿等 編著《數(shù)據(jù)庫(kù)開(kāi)發(fā)及工程實(shí)例》 人民郵電出版社 姚魏 編著《數(shù)據(jù)庫(kù)系統(tǒng)開(kāi)發(fā)技術(shù)》 人民郵電出版社 郭琦 編著《VISUAL BASIC 數(shù)據(jù)庫(kù)開(kāi)發(fā)技術(shù)與工程實(shí)踐》 人民郵電出版社 求是科技 編著《深入學(xué)習(xí):VISUAL BASIC 》 電子工業(yè)出版社 [美] dan fox 編著 18 / 18