版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認(rèn)領(lǐng)
文檔簡介
實用文案VisualBasiclanguageandarithmeticTheUnitedStateslaunchedtheMicrosoftVisualBasic(maybereferredtoVB),isthelatestversionofthecurrentVB2008Beta2(VB9)Chineseversion.Visualmeaningthevisual,visible,referringtothedevelopmentofoperating systems likewindows graphical userinterface (Graphic UserInterface,GUI)method,itdoesnotneedtopreparealargenumbercodetodescribetheappearanceoftheinterfaceelementsandlocation,aslongasthepre-Theestablishmentofgooddraganddropobjectsonthescreencorrespondingtothelocation.Basicisactuallyanabbreviationofthephrase;thisphraseisBeginnersall-purposesymbolicinstructioncode,theChinesemeaning"totheinitialdirectiveGMsymbolcodelanguage."VisualBasiclearning,ProfessionalEditionandEnterpriseEditionversionstomeetthedifferentneedsofthedevelopment.StudyandapplytotheordinaryversionofthemajorityoflearnersandtheuseofVisualBasicdevelopmentofthegeneralstaffofWindowsapplications,but;professionalversionforcomputerprofessionaldevelopmentofstaff,includingthestudyoffunctionalversionofthefullcontentcontrolandInternetdevelopmenttoolssuchasadvancedfeatures,Enterprisecontainnotonlyalltheprofessionalversionofthecontent,thereareautomatedtoolssuchasComponentManager,professionalprogrammerstomakethedevelopmentofapowerfulgroupessenceofdistributedapplications.VisualBasicSection1thesummaryofVisualBasicMicrosoftVisualBasic,(abbreviateVB)astoolthemostofapplicationprogramoneofunderWindowsoperatingplatform.Nomatterbeginnerorprofessionaldeveloper,VBhasallofferedawholesetoftoolstothem,Developmentapplicationprogramthatitcanberelaxedandconvenient.SoVBasmostcomputerfirst-selectedtheABCofprogramminglanguageofbeginner.Visual"meanmethodtoadoptvisualuserofdevelopmentfigureinterface(GUI),needandwritealargenumberofcodegoanddescribe標(biāo)準(zhǔn)實用文案interfaceappearanceandpositionofelementseldom,Towandshowcontrollingpartthatneedcorrespondingpositiontogetscreencanhelpfiguredesigninterface,useroffigure,;"Basic"meansBASIClanguage,becauseVBisdevelopedonthebasisofalreadyexistingBAISClanguage.VBisakindofprogramminglanguageincommonuseofMicrosoft,It,includingVBAofthenumerousWindowsapplicationsoftwareuseVBlanguageinMicrosoftExcel,MicrosoftAccessed.,Foruserstocarryonthesecondarydevelopment;MakewebpageusemoreVBScriptscriptlanguagesubcollectionofVBtooatpresent.UtilizedataofVBvisitcharacteristicusercanestablishthedatabasetomostdatabaseformsincludingMicrosoftSQLServerandotherenterprisesdatabaseWiththeapplicationprogramoffront,andadjustableserviceendpart.UtilizeActiveX(TM)technology,VBcanusewordprocessor,electronicdatalistheWindowsfunctionthatapplicationprogramoffersextremely,ExcelofMicrosoft,,WordofMicrosoft,,EvencanusebyVBspecialtyeditionorenterpriseapplicationprogramandtargetthateditionestablishdirectly.Theprocedurethatusersestablishedfinallyisareal.EXEfile,canissuefreely.VBofferstudyedition,thespecialtyeditionandenterpriseedition,usetosatisfiedwithdifferentdevelopmentdemands.StudyeditionmakeprogrammingpersonneldevelopWindowsandWindowsapplicationprogramofNTveryeasily.Thespecialtyeditionhasofferedthedevelopinginstrumentwithcompletefunctiontoprogrammingpersonnelofthespecialty,Includestudyingallfunctionsofeditioninthespecialtyedition.Enterpriseeditionallowtheprofessionalpersonneltoestablishstrongdistributedapplicationprogramintheformofgroup.Itincludesallcharacteristicsofthespecialtyedition.Socanchoosedifferenteditionsaccordingtodifferentneeds.Section2integrateddevelopmentenvironmentsIntegratedenvironmentofVBcallIDE,madeupofalotofparts,includetitleboard,menufence,toolfence,controllingpartcase,Andwindowbodywindow,engineeringmanagementdevicewindow,attributewindow,codewindowandwindowbodyoverallarrangement標(biāo)準(zhǔn)實用文案windowbodyoverallarrangement,etc.ofdesigningetc..Havecoveredallfunctions,suchasdesignwhichdevelopstheapplicationprogram,editting,compilinganddebugging,etc..InVB,theapplicationprogramcallstheprojecttoo.WhenstartVBandopenanewprojectforthefirsttime,canseeandpursueintegrateddevelopmentenvironmentinterfacethatshow.VisualBasicIntegrateddevelopmentenvironmentVBcomeandorganizedevelopmentofapplicationprogramthroughproject,useprojectcomeandmanageandformfilesofapplicationprogram.Oneprojectusestheenvironmenttomakeupbyseveralwindowbodies,standardmodulegenerally.Thesystemmanagesprojectthroughtheprojectmenu,forinstanceaddthewindowbody,quote.Systemallowturnonandmanagealotofprojectsbesides.Section3VisualBasiclanguagebriefintroductionsBasicuseanddotheelementaryhigh-levellanguagethatusedoftenmost.ItsfullnameisBeginner'sAll-purposeSymbolicInstructionCode,abbreviateasBASIC.Asitsnamesuggests,Basiconespeciallyforlanguagethatbeginnerdesign,becauseiteasytolearneasytoknow,Sothebodyispopular.EarlyBasiclanguagetobelongtoandsolvetranslatingtype,socancarryoutlinebyline,Soitcanseetheresultcarriedoutatonce,thisisaveryconvenientdesignforbeginner.Butithaveconceptofstructureeither,onethatisinproceduremaintainandmanagementhaveasmuchasotherlanguageproblems.Butback-endBasiccorrectshortcomingoftheabove(suchasQuickBasic),makeitmayusedforanddevelopthelarge-scalerproceduretoo.Thelanguageisthebasiccomposition,whichformsVBprocedure.VBhasstipulatedtheformofsentencesandfunction.Grammar:Thesentencedefinesincantations[Sentencebody]Sentencedefineagreewithandusedinfixedfunctionofsentence,sentencebodyappointconcretecontentorwantconcreteoperationthatcarryoutofsentence.AllsetofsentenceVBlanguage,carryonwithVBsentenceorganicassociationfinishacertainspecificfunctiontheprocedure.Interface+procedurecansolveacertainapplication標(biāo)準(zhǔn)實用文案problem.VBapplicationprogramcodewindowwritein"codeeditingmachine"generally."editingmachineofcode"islikethewordprocessingsoftwareofapieceofheightspecialization,therearemanyeasiesfunctionofwritingVBcode,Pursuetoshow[ExampleEx-Hello]In"codeeditingmachine"codethatwindowwritten.“Editingmachineofcode”windowSection4developtheapplicationprogramwithVisualBasicUseVBprogramming,designappearanceofapplicationprogramfirstgenerally,writeeverytargetprocedurecodeorothertreatmentprocedureofincidentrespectively,Workofprogrammingshouldbelightmore.Theprocedureofestablishingtheapplicationprogramisasfollows:EstablishapplicationprograminterfaceTheinterfaceisthemutualbridgeofuserandprocedure,Generallyformedofwindowbodyandvisionframeofthebutton,menu,textframeset.withstandardWINDOWSinterfaceofapplicationprogramthatVBestablish.Requireaccordingtofunctionofprocedureanduserandneedofinformationinterchangeofprocedure,Cometoconfirmthatneedthosetargets,plantheoverallarrangementoftheinterface.2.DesignbyeachattributesoftargetininterfaceDemandandsetupeachattributeoftargetsuchasappearance,name,,sizeoftargeted.accordingtointerfaceofplanning.Mostattributepersonwhofetchcansetupthroughtheattributewindowwhendesignalready,Toocansetuprevisingwhenoperatinginprocedurethroughprogramminginprocedurecode.Havethetargetsrespondprogrammingbyprocedurecode3.RespondprocedurecodeofprogrammingtargetInterfacedetermineappearanceofprocedureonly,designwindowaddcodesthrough"codeeditingmachine"soonaftertheinterface,Realizesomemakethetasks,suchasresponding,informationprocessing,etc.afteracceptingexternalmessage,Addcode,realizesomeresponse,informationprocessingthatmakeafteracceptingexternalinformationtask,Aseditor'swindowofcodepursuedshows標(biāo)準(zhǔn)實用文案addcodes“codeeditingmachine”window4.KeepprojectOneVBprocedureoneproject,atthetimeofdesigningaapplicationprogram,systemwillsetuponebeexpandedandcalled.Projectfileofvbp,projectfileincludeallrelevantinformationoffilethatprojectsetupthis,Keepprojectkeepassociateddocumentsofprojectthisatthesametime.Forexamplethewindowbodyproducedwhendesigninterfacesiskeptandbeingexpandedandbeingcalled.Frmsum.Inthewindowbodyoffoxfire.Atthetimeofopeningaproject(file),thisprojectrelevantfilesloadatthesametime.5.OperateanddebuggedbyprocedureOperatetheprocedurethoroughpinoperate"selectinginthemenu,whenthemistakeappears,VBsystemcanofferinformationpromptcanlookedforandgetridofthemistakethoroughpindebug"withinoperate"menustoo.6.CanproducebyexecutiveprogramFormakeprocedurecanbreakawayfromVBenvironment,ordertobecomenextlifethrough"file""producingproject1.exe"ofmenubutexecutiveprogram(eyeful),Cancarryoutthisfiledirectlyafterthis.Inproduce,+executiveprogram,andthenthroughinstallguidebaleallassociateddocuments,Canrunindependentlyafterinstallationundertheenvironmentofwindows9x/2000asasoftwareproduct.Incomputersystem'sanysoftware,isbytheeverylargeorsmalleachkindofsoftwareconstituentconstitution,deferstothespecificalgorithmtorealizerespectively,thealgorithmqualitydirectdecisionrealizesthesoftwareperformancefitandunfitquality.Designsthealgorithmwithanymethod,whatresourcesdesignsthealgorithmtoneed,requireshowmanyrunningtime,howmanystoragespace,howtodetermineanalgorithmthequality,whenrealizesasoftware,ismustgivetosolve.Incomputersystem'soperatingsystem,thelanguagecompilingsystem,thedatabasemanagementsystemaswellasinvariouscomputerapplicationsystem'ssoftware,mustuseeachoneconcretealgorithmtorealize.Therefore,thealgorithmdesignandtheanalysisarethe標(biāo)準(zhǔn)實用文案computerscienceandatechnicalcorequestion.Thealgorithmistheproblem-solvingstep,wemaydefinethealgorithmChengJieadeterminationclassquestiontherandomonespecialmethod.Inthecomputerscience,thealgorithmneedstousethecomputeralgorithmiclanguagetodescribe,thealgorithmrepresentswiththecomputersolvesakindofquestionprecisely,theeffectivemethod.Thealgorithmconstructionofdata=procedure,solvesonetoassignmaycalculateorthesolvablequestion,thedifferentpersonmaycompilethedifferentprocedure,solvestheidenticalproblem,herehastwoproblems:First,withcomputationalmethodcloserelatedalgorithmquestion;Second,programmingtechnicalquestion.Betweenthealgorithmandtheprocedurehasthecloserelationship.Thealgorithmisagrouphasthepoorrule,theyhadstipulatedsolvessomespecifictypequestionaseriesofoperations,istotheproblemsolvingplanaccurateandthecompletedescription.Formulatesanalgorithm,generallymustpassthroughstagesandsoondesign,confirmation,analysis,code,test,debugging,time.Toalgorithmstudyincludingfiveaspectcontents:①Designalgorithm.Thealgorithmdesignworkisimpossiblecompletelytheautomation,shouldstudytheunderstandingalreadybythepracticetoprovethatwastheusefulsomebasicalgorithmdesignmethod,thesebasicdesignmethodwasnotonlysuitableforthecomputerscience,moreoverwassuitablefordomainsandsoonelectricalengineering,operationsresearch;②Expressesthealgorithm.Thedescriptionalgorithm'smethodhasmanykindsofforms,forexamplethenaturallanguageandthealgorithmiclanguage,havethesuitableenvironmentandthecharacteristicrespectively;③Confirmsthealgorithm.Thealgorithmconfirmedthegoaliscausesthepeopletobelievefirmlythatthisalgorithmcanworkunmistakablycorrectly,namelythisalgorithmhasthecircularity.Thecorrectalgorithmdescribeswiththecomputeralgorithmiclanguage,constitutesthecomputerprogram,thecomputerprogrammovesonthecomputer,obtainsthealgorithmoperationresult;④Parsingalgorithm.Thealgorithmicanalysisisrequireshowmanycomputingtimeandthestoragespacetoanalgorithmmakesthequotatheanalysis.Theparsingalgorithmmayforecastthatwhatenvironment標(biāo)準(zhǔn)實用文案thisalgorithmdoessuitinmoveseffectively,tosolvestheidenticalquestiondifferentalgorithmvaliditytomakethecomparison;⑤Confirmationalgorithm.Withmachinelanguagedescriptionalgorithmwhethercancalculateeffectively,reasonable,mustcarryonthetesttotheprocedure,thetestorderworkandmakesthespaceandtimedistributionmapbythedebuggingtobecomposed.Butthealgorithmhascertaincharacteristic,itincludes:①Determinism.Algorithmeachkindofoperationmusthavethedeterminationsignificance,thiskindofoperationshouldcarryoutwhatkindofmovementshouldnottohavetheambiguity,thegoalisclear;②Effectiveness.Requeststheoperationwhichinthealgorithmwaitsforrealizingisbasic,eachkindofoperationcanatleastcompletesintheprinciplebythehumanwiththepaperandthepeninthelimitedtime;Input.Analgorithmhas0orthemanyinputs,beforethealgorithmoperationstartsgivesthealgorithmtoneedthedatathestartingvalue,theseinputsarefromthespecificobjectset;④Output.Doesforthealgorithmoperationresult,analgorithmhasormanyoutputs,theoutputhassomekindofspecificrelationalquantitywiththeinput;⑤Haspoor.Analgorithmalwaysaftercarryingouthadthepoorstepoperationhasterminated,namelythisalgorithmwasmayreach.Satisfiesafirstfourcharacteristicgroupofrulenottobeabletobecalledthealgorithm,canonlybecalledthecomputationalprocess,theoperatingsystemisacomputationalprocessexample,theoperatingsystemusesfortomanagethecomputerresources,controlsthemanufactureindustrymovement,whenhasnotmadeindustrythemovement,thecomputationalprocessdoesnotstop,butisatthewaitingstatus.Thealgorithmcomplexityisthealgorithmefficiencymeasure,whenappraisesthealgorithmperformance,thecomplexityisanimportantbasis.Thealgorithmcomplexdegreewithmovescomputerresourceshowmanywhichthisalgorithmneedsrelated,needstheresourcesaremore,indicatedthatthisalgorithmthecomplexityishigher;Needstheresourcesareless,indicatedthatthisalgorithmthecomplexityislower.Thespatialresources,whichcomputer’sresources,operatemost標(biāo)準(zhǔn)實用文案importantly,needsthetimewhichandthestoredroutineandthedataneed,thealgorithmcomplexityhasdivisiontimecomplexityandthespatialcomplexity.Thealgorithmcarriesouttheoperationonthecomputer,needsthedata which certain storage spacedepositing description algorithm theprocedure and the algorithm need, the computer completes theoperation task to require certain time. The procedure which writesaccording to the different algorithm places when on the computeroperates, needs the time and the space aredifferent, the algorithmcomplexityisneedsthetimeandthespatialonekindofmeasuretothealgorithm operation. The different computer its operating speeddifferenceisverybig,isweighinganalgorithmthecomplexitytonotethispoint.Regardingquestion,whichassignswillfully,aprofitabletargetwhichdesigns, the complexlow algorithm isasfaraspossible when designsalgorithm considered. Moreover, when the question, which assignsalreadywhenhasmanykindsofalgorithms,animportantcriterionwhichchoicecomplexitylow,iswhenselectsalgorithmshouldfollow.Therefore,thealgorithmcomplexanalysisorselectstothealgorithmdesignhastheimportantguidingsenseandtheusevalue.When discussion algorithm complexity, two questions needtoclarify:(1)Analgorithm'scomplexityexpresseswithwhatkindofquantity;(2)Howtocalculateonetoassignthealgorithmthecomplexity.Afterfindingsolvesaquestionthealgorithm,isthisalgorithmrealization,asforwhethercouldfindthemethodwhichrealized,wasdecidedinthealgorithmcircularityandthecomputationcomplexity,whetherthisquestiondidhavethesolutionalgorithm,whethertoprovidethetimeresourceswhichandthespatialresourcesthealgorithmneeded.標(biāo)準(zhǔn)實用文案VisualBasic 語言與算法1991年,美國微軟公司推出了 VisualBasic(可簡稱VB),目前的最新版本是VB2008Beta2(VB9)中文版。Visual意即可視的、可見的,指的是開發(fā)像windows操作系統(tǒng)的圖形用戶界面(GraphicUserInterface,GUI)的方法,它不需要編寫大量代碼去描述界面元素的外觀和位置,只要把預(yù)先建立好的對象拖放到屏幕上相應(yīng)的位置即可。Basic實際上是一個短語的縮寫,這個短語就是 Beginners all_purposesymbolicinstructioncode ,其中文意思為“初始者通用符號指令代碼語言” 。VisualBasic有學(xué)習(xí)版、專業(yè)版和企業(yè)版三種版本,以滿足不同的開發(fā)需要。學(xué)習(xí)版適用于普通學(xué)習(xí)者及大多數(shù)使用 VisualBasic開發(fā)一般Windows 應(yīng)用程序的人員,但是;專業(yè)版適用于計算機專業(yè)開發(fā)人員, 包括了學(xué)習(xí)版的全部內(nèi)容功能以及Internet 控件開發(fā)工具之類的高級特性;企業(yè)版除包含專業(yè)版全部的內(nèi)容外,還有自動化構(gòu)件管理器等工具, 使得專業(yè)編程人員能夠開發(fā)功能強大的組骨子里分布式應(yīng)用程序。VisualBasic第1節(jié)VisualBasic 的概述標(biāo)準(zhǔn)實用文案MicrosoftVisualBasic( 簡稱VB)是在Windows 操作平臺下設(shè)計應(yīng)用程序的最速度、最簡捷的工具之一。不論是初學(xué)者還是專業(yè)開發(fā)人員, VB都為他們提供了一整套的工具,可以輕松方便的開發(fā)應(yīng)用程序。因此, VB一直被作為大多數(shù)電腦初學(xué)者的首選入門編程語言。“Visual”指的是采用可視化的開發(fā)圖形用戶界面( GUI)的方法,一般不需要編寫大量代碼去描述界面元素的外觀和位置,而只要把需要的控件拖放到屏幕上的相應(yīng)位置即可方便圖形設(shè)計圖形用戶界面;“Basic”指的是BASIC語言,因為VB是在原有的BAISC語言的基礎(chǔ)上發(fā)展起來的。VB是Microsoft 的一種通用程序設(shè)計語言,它包括在 MicrosoftExcel 、MicrosoftAccess 等眾多Windows 應(yīng)用軟件中的VBA都使用VB語言,以供用戶進行二次開發(fā);目前制作網(wǎng)頁使用較多的 VBScript 腳本語言也是VB的子集。利用VB的數(shù)據(jù)訪問特性用戶可以對包括 MicrosoftSQLServer 和其他企業(yè)數(shù)據(jù)庫在內(nèi)的大部分?jǐn)?shù)據(jù)庫格式創(chuàng)建數(shù)據(jù)庫和前端應(yīng)用程序, 以及可調(diào)整的服務(wù)端部件。利用 ActiveX(TM) 技術(shù),VB可使用Microsoft Word 字處理器、Microsoft Excel電子數(shù)據(jù)表極其他 Windows 應(yīng)用程序提供的功能,甚至可直接使用由VB專業(yè)版或企業(yè)版創(chuàng)建的應(yīng)用程序和對象。用戶最終創(chuàng)建的程序是一個真正的 .EXE文件,可以自由發(fā)布。VB提供了學(xué)習(xí)版,專業(yè)版和企業(yè)版,用以滿足不同的開發(fā)需求。學(xué)習(xí)版使編程人員很容易地開發(fā) Windows 和WindowsNT 的應(yīng)用程序。專業(yè)版為專業(yè)編程人員提供了功能完備的開發(fā)工具, 專業(yè)版中包含了學(xué)習(xí)版的所有功能。 企業(yè)版允許專業(yè)人員以小組的形式來創(chuàng)建強大的分布式應(yīng)用程序。 它包括專業(yè)版的所有的特性。所以可以根據(jù)不同的需要來選擇不同的版本。第2節(jié)集成開發(fā)環(huán)境VB的集成環(huán)境或稱 IDE,由多個部分組成,包含了標(biāo)題欄、菜單欄、工具欄、控件箱,以及窗體設(shè)計器窗口、工程管理器窗口、屬性窗口、代碼窗口和窗體布局窗體布局等。覆蓋了開發(fā)應(yīng)用程序的設(shè)計、編輯、編譯和調(diào)試等所有功能。在VB中,應(yīng)用程序也稱工程。當(dāng)?shù)谝淮螁?VB并打開一個新工程時,可以看到如圖所示的集成開發(fā)環(huán)境界面。VisualBasic 集成開發(fā)環(huán)境VB通過工程來組織應(yīng)用程序的開發(fā),使用工程來管理構(gòu)成應(yīng)用程序的所有文件。一個工程一般由若干個窗體、 標(biāo)準(zhǔn)模塊以及應(yīng)用環(huán)境組成。 系統(tǒng)通過工程菜單來對工程進行管理,如添加窗體、引用等。系統(tǒng)允許同時打開和管理多個工程。標(biāo)準(zhǔn)實用文案第3節(jié)VisualBasic 語言簡介Basic是最常被用來做入門使用的高級語言。它的全名是 Beginner’sAll-purposeSumbolicInstructionCode ,簡稱為 BASIC。顧名思義,Basic就是一種專為初學(xué)者設(shè)計的語言,因其易學(xué)易懂,所以身受歡迎。早期的 Basic語言都是屬于解譯式的,因此可以一行一行地執(zhí)行,所以它可以立刻看到執(zhí)行的結(jié)果,對初學(xué)者來說這是很方便的設(shè)計。不過它也因此沒有結(jié)構(gòu)化的概念,在程序的維護及管理上比起其他語言困難許多。不過在后期的Basic則改正了以上的缺點(如QuickBasic),使得它也可以用來開發(fā)較大型的程序。語言是構(gòu)成VB程序的基本成分。VB規(guī)定了語句格式和功能。語法:語句定義符[語句體]語句定義符用于規(guī)定語句的功能,語句體指定語句的具體內(nèi)容或要執(zhí)行的具體操作。所有語句的集合就是VB語言,用VB語句進行有機組合完成某個特定功能就是程序。界面+程序就能解決某個應(yīng)用問題。VB應(yīng)用程序代碼一般在“代碼編輯器”窗口編寫。“代碼編輯器”像是一個高度專門化的字處理軟件,有很多便于編寫 VB代碼的功能,圖所示為 [例Ex-Hello]在“代碼編輯器”窗口編寫的代碼?!按a編輯器”窗口第4節(jié)用VisualBasic開發(fā)應(yīng)用程序使用VB編程,一般先設(shè)計應(yīng)用程序的外觀,然后再分別編寫各對象事件的程序代碼或其他處理程序,編程的工作要輕松多。創(chuàng)建應(yīng)用程序的步驟如下:1.創(chuàng)建應(yīng)用程序界面界面是用戶和程序交互的橋梁,用 VB創(chuàng)建的標(biāo)準(zhǔn)的WINDOWS 應(yīng)用程序的界面一般由窗體和按鈕、菜單、文本框的圖象框等構(gòu)成。根據(jù)程序的功能要求和用戶與程序之間的信息交流的需要,來確定需要那些對象,規(guī)劃界面的布局。2.設(shè)計界面上各個對象的屬性根據(jù)規(guī)劃的界面要求設(shè)置各個對象的屬性,比如對象的外貌、名稱、顏色、大小等。大多數(shù)屬性取值既可以在設(shè)計時通過屬性窗口來設(shè)置, 也可以在程序代碼中通過編程在程序運行時設(shè)置修改。3.編程對象響應(yīng)的程序代碼界面僅僅決定了程序的外觀,設(shè)計完界面后就要通過“代碼編輯器”窗口來添加代碼,實現(xiàn)一些在接受外界信息后作出響應(yīng)、信息處理等任務(wù),標(biāo)準(zhǔn)實用文案添加代碼,實現(xiàn)一些在接受外界信息后作出的響應(yīng)、信息處理等任務(wù),添加代碼如圖的代碼編輯窗口所示“代碼編輯器”窗口4.保存工程一個VB程序就是一個工程,在設(shè)計一個應(yīng)用程序時,系統(tǒng)會建立一個擴展名為.vbp 的工程文件,工程文件包含了該工程所建立的所有文件的相關(guān)信息,保存工程就同時保存了該工程的所有相關(guān)文件。比如當(dāng)設(shè)計界面時產(chǎn)生的窗體保存在擴展名為.frm和.frx的窗體文件中。在打開一個工程(文件)時,該工程有關(guān)的所有文件同時被裝載。5.行和調(diào)試程序通過“運行”菜單中的選項來運行程序,當(dāng)出現(xiàn)錯誤時, VB系統(tǒng)可以提供信息提示也可通過“調(diào)試”和“運行”菜單來查找和排除錯誤。6.生成可執(zhí)行程序為了使程序可以脫離VB環(huán)境,通過“文件”菜單中的“生成工程1.exe”命令來生成可執(zhí)行程序(.exe文件),此后即可直接執(zhí)行該文件。在生成可+執(zhí)行程序后,再通過安裝向?qū)⑺邢嚓P(guān)文件打包,就可以作為一個軟件產(chǎn)品在windows9x/2000環(huán)境下安裝后獨立運行VB的數(shù)據(jù)庫編程方面按其難易程度可分為三類(由易到難);●使用數(shù)據(jù)庫控制項和綁定控制項●使用數(shù)據(jù)庫對象變量進行編程●直接調(diào)用ODBC2.0API在使用VB進行數(shù)據(jù)庫編程時,通常,會首先選擇三種基本方法之一來進行數(shù)據(jù)庫應(yīng)用程序的方案設(shè)計 ,現(xiàn)在就將以上三種設(shè)計方法的適應(yīng)范圍及其優(yōu)缺點進行一個比較。使用數(shù)據(jù)庫控制項和綁定控制項1.1優(yōu)點它是三種方法中編碼量最小的不必了解CDBC2.0API的細(xì)節(jié)允許使用標(biāo)準(zhǔn)的和第三方廠商制訂的控制項簡化了錯誤處理支持所有的動態(tài)集方法及屬性1.2缺點不能存取快照對象(snapshop)對象或表格對象(都屬于記錄集對象)不能存取數(shù)據(jù)庫集合,比如表定義(TableDefs)字段(Fieds),索引(Indexes)標(biāo)準(zhǔn)實用文案及查詢定義(QueryDefs)只能存取部分ODBC2.0管理函數(shù)不能進行真正的事務(wù)處理有限的錯誤診斷功能1.3應(yīng)用對中小規(guī)模的數(shù)據(jù)庫表(通常少于一千條記錄)只進行簡章的瀏覽操作基本SQL查詢所對應(yīng)的結(jié)果集長度有限(通常結(jié)果集的記錄數(shù)小于一百,這些記錄從一個或兩個長度有限的表中檢索出來)應(yīng)用程序的數(shù)據(jù)輸入/輸出項較少(通常只涉及一個或兩個長度有限的表、并且表中的字段數(shù)在10個左右且不具有關(guān)系完整性限制使用數(shù)據(jù)庫對象變量進行編程2.1優(yōu)點可以在程序中存取 ODBC2.0的管理函數(shù)可以控制多種記錄集類型 :Dynaset、Snapshop 及Table記錄集合對象可以存取存儲過程和查詢動作可以存取數(shù)據(jù)庫集合對象 ,例如TableDefs、Fields、Indexes及QueryDefs具有真正的事務(wù)處理能力 ,包括啟動事務(wù) (Begintrans) 、提交事務(wù)(CommitTrans) 及回滾事務(wù)(Rollback)2.2缺點比使用數(shù)據(jù)控制項的方法編碼量較大只能進行間接的錯誤處理和錯誤恢復(fù)對每個數(shù)據(jù)庫操作沒有細(xì)粒度的控制對結(jié)果集和包含結(jié)果集的內(nèi)豐資源的操作受到限制同直接使用ODBC2.0API函數(shù)的方法相比性能較低2.3應(yīng)用應(yīng)用程序需要在執(zhí)行期間動態(tài)地建立表、字段及索引 .應(yīng)用程序涉及同步更新幾張表 (但在邏輯上保持一致性 )的復(fù)雜事務(wù)應(yīng)用程序使用結(jié)果集而不是 Dynaset 的窗體(FORMS),例如Snapshots 或Tables,這里是設(shè)計要考慮的關(guān)鍵應(yīng)用程序的表非常大,多于1000條記錄應(yīng)用程序具有復(fù)雜的數(shù)據(jù)輸入 /輸出項,它涉及許多內(nèi)部相關(guān)的字段并且包括數(shù)據(jù)庫參照完整性或一致性規(guī)則應(yīng)用
溫馨提示
- 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)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 校園宣傳片解說詞
- 貨物運輸長期合同(4篇)
- 2024-2025學(xué)年第一學(xué)期期中南京市六校聯(lián)合調(diào)研試題高一數(shù)學(xué)
- 黑龍江雞西市(2024年-2025年小學(xué)五年級語文)統(tǒng)編版摸底考試(下學(xué)期)試卷及答案
- 2024年輕質(zhì)高強復(fù)合材料項目投資申請報告
- 2024年LED室內(nèi)應(yīng)用燈具項目投資申請報告代可行性研究報告
- 標(biāo)準(zhǔn)文本-青貯玉米中酸性洗滌纖維的測定
- 上海市縣(2024年-2025年小學(xué)五年級語文)人教版綜合練習(xí)((上下)學(xué)期)試卷及答案
- 新學(xué)期教師動員培訓(xùn)
- 江西省宜春市宜豐中學(xué)2024-2025學(xué)年高一上學(xué)期期中考試地理試題(含答案)
- 工程交付培訓(xùn)記錄表
- 《個別化教育的理論與實踐》教學(xué)大綱
- 精益道場建設(shè)方案與步驟課件
- 對監(jiān)獄心理矯治工作存在的問題與對策的幾點思考
- 廉潔文化進校園班級主題班會
- 一年級拼音每日拼讀練習(xí)
- 七年級上冊生命、生態(tài)、安全教案 全冊
- 下穿有軌電車專項監(jiān)測方案
- 古詩句接龍100首
- 大眾汽車北美市場案例(ppt-35頁)課件
- 坐井觀天 (5)
評論
0/150
提交評論