计算机软件工程外文翻译外文文献英文文献VB的数据库编程分析数据库的发展、应用和基本原理_第1页
计算机软件工程外文翻译外文文献英文文献VB的数据库编程分析数据库的发展、应用和基本原理_第2页
计算机软件工程外文翻译外文文献英文文献VB的数据库编程分析数据库的发展、应用和基本原理_第3页
计算机软件工程外文翻译外文文献英文文献VB的数据库编程分析数据库的发展、应用和基本原理_第4页
计算机软件工程外文翻译外文文献英文文献VB的数据库编程分析数据库的发展、应用和基本原理_第5页
已阅读5页,还剩8页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、ANALYSIS OF DATABASE PROGRAMMING IN VBVB (Visual Basic) is a visualization programming environment that Microsoft Corporati on promotes based on the Basic Ian guage .It is simple and easy to stud yt has formidable function so that many computer amateurs really like it.A lot of application softwares

2、all use VB as the software developme nt platform.Whe n we use VB to develop the application software,how to use the databaseand carry on the management of the database is concerned by all exploiters.VB has provided many tools and methods for database program min g.What method is used to visit the da

3、tabase depe nds on users different demands,a simple analysis of the VB database programming is explained as followi ngs.1. DAO TechnologyBy using Microsoft compa nys Jet Database Engine (Jet database engin e),DAO (Data Access Object) the tech no logy mainly provides visit to ISAM (smooth in dex sear

4、ch method) type database,such as the realizati on of the visit to database like FoxPro,Access, Dbase.1.1 Use Data ControlsData controls are produced by using “ Data ”utton in the toolboxt has 3 basic attributes:Connect,Database Name and RecordSource.Connect attribute specifys the database type that

5、data con trols visit,the default database is the Access database.The value of the Database Name attribute is the databasefile name which contains the complete path.The Record Source attribute is the recordset that we visit,also can be tables or SQL senten cesf we will visit table stud of database fi

6、le teacher mdb of TEMP folder un der D plate,then Data controlss Connect attribute is null,and the Database Name attribute is D: temp teacher mdb”,the value of the Record Source attribute is tud”.This can accomplish the bin di ng betwee n Data con trols and database records. Through the methods of D

7、ata con trols like Add n ew,Update,Delete, Move last,we can visit the database as every request.Whe n we browse the content in database,Datac on trolls is used freque ntly with DBGrid,it provides data inquiry in grid way.1.2 Use DAO Object StorehouseThe model of the DAO object storehouse is mainly u

8、sing hierarchical structure, Den ti ne is the object in the topmost story,below it are two object sets,Errors and workspace, un der the workspace object,is the Databases set.Whe n the applicati on procedure quotes the DAO object storehouse,it produces only a Dentine object,and produces a default aut

9、omatical working space object named workspace.When not mentioned,all database operations are all work in workspace(O),which is a default work area.But we must pay atte nti on: The Jet engine will not starts automatically after VB has bee n loaded. On ly whe n we choose Referencesin the menu of Proje

10、ct can we select Microsoft DAO 3.5 Object Library to use.We create databaseswith the method “ CreateDatabase ”in DAO,useCreateTabld method to bulid tables,use the Open Database” to open the database ,use Open recordsefmethod to open recordset,useAdd new,Update,Delete,Move first,Edit methods to reali

11、ze each kind of operati ons about tables.2. RDO TechnologyRDO provides a connection to related ODBC data pool.Whe n we n eed to visit other databaseslike SQL Server,Oracle,especiallyto establish the customer/server application procedure,we may use the long range data con trols RDC (Remote Data Con t

12、rol) and long range data objects RDO (Remote Data Con trol) to realize the visit to the database through the ODBC driver.By using ODBC to visit some databasewe must first in stall the corresp onding drivers,like establish a data pool,through assigned data pool to visit corresponding database.Toestab

13、lish the ODBC data pool is open the window of “thecontrol panel ” double-clicks the icon of ODBC executive program,single-click “Add”button to create the data pool of the opening ODBC data pool supervisor dialog box,and choose corresp onding database.2.1 Use RDC ControlsSimilar to the use of DATA Co

14、n trols, we use Data source n ame attributes to assig n the data source n ame that con trols bin d,a nd we use SQL attributes to assig n the recordset, The differe nee is that,we have to use the SQL senten ces to assig n the SQL attribute in RDC Con trols . Whe n we browse the database we may find i

15、t is used with DBGrid freque ntly.2.2 Use RDO Object StorehouseBefore we use RDO object,we should choose References in the menu of Project, click Microsoft Remote Data Object 2.0,then we can continue.The step we use RDO to visit the ODBC data pool is:(1) Set a RDO en viro nmen t object.(2) Ope n an

16、ODBC data pool with the method of Ope n conn ecti on.(3) Establish a result object with the method of Open Result set.(4) Use assig ned method to operate the records of resultset.After founds the as this result collection object,is similar with the DAO object storehouseuse,may through tran sfer meth

17、od realizati ons and so on its Add n ew,Update, Delete visit to assig n the data pool each kind of request.3. ADO TechnologyADO (ActiveX Data Objects) is the latest data access tech no logy of Microsoft,It uses data access ing conn ecti on UDA (Uni versal Data Access),to sta ndard all datas as a ki

18、nd of data pool,through the filtratio n of OLEDB connection ,tra nsforms as a kind of gen eral data format in the same way,enables the application procedure to visit this kind of datas.OLEDB is an un derly ing level of the data access ing conn ecti on, with it we may visit kinds of data pools,i nclu

19、di ng traditi onal related databases,as well as electr onic mail system iiand self-defi niti on commercial object.3.1 Use ADO ControlsSin gle-click the Comp onents comma nd in the menu of the Project,select Microsoft ADO Data Control in the Components dialog box 6.0 (OLE DB) ”,we may add ADO con tro

20、ls to the box of con trols.We set the OLEDB Provider and assigned databasefile by setting the Connection stri ng attribute of ADO,a nd we set the Record Source attribute as record source that ADO connected.Similar to DAO and RDO, with it, we are able to visit all kinds of database fastly.3.2 Use The

21、 ADO Object StorehouseSingle click the Referencesorders in the Project menu, select “ MicrosoftActiveX Data Objects 2.0 Library ” in the Refere nces dialog boay add ADO object.Old object models, like DAO and RDO, are look like levels,a lower data object like Recordset is the sub-object of higher lev

22、el objects like En vir onment and the Queried. But ADO is actually differe nt, it defi ned a group of pla ne top object, the most importa nt ADO objects are Conn ecti on, Recordset and Comma nd.The Conn ecti on object is used to establish the connection of applicati on procedure and the data pool.Th

23、e Comma nd object is used in defi ning a SQL senten ce,a memory process or other comma nds that operatesthe datas.Recordseobject preservesrecordsets after executi ons.By using alter native means of the recordset object, we can modify,delete and inquire the recordset.4 ConclusionsVB provides many met

24、hods to accomplish the operation to the database,in which DAO main ly fin ish the visit to ISAM database, RDO provides conn ection to the ODBC data pool, both RDO and DAO have developed as matured tech no logy.Before VB 6.0 ,the main tech no logy is about database visit, however,the Active Data Obje

25、cts(ADO) ,as new gen eratio n of database in terface which is promoted by Microsoft, is desig ned to work with new data access ing level OLEDB, so that it provides gen eral data access in g(U ni versal Data Access), it provides quite a lot adva ntages to the programmers, in cludi ng easy use, the fa

26、miliar con tact surface, high velocity ,as well as the lower memory. As a result of above reasons, ADO will gradually replace other data accessing connections, and will becomes the fun dame ntal mode of the VB of visit database.12VB的数据库编程分析VB (Visual Basic)是微软公司推出的基于 Basic语言的可视化编程环境,以其 简单易学、功能强大而倍受广

27、大电脑爱好者的青睐。很多应用软件都采用VB作为软 件开发平台。在用VB开发应用软件的过程中,如何使用数据库并对数据库进行管理 是所有开发者关心的问题。VB为数据库的编程提供了很多的工具和方式,究竟采用 何种方式进行数据库的访问依赖于用户的不同需求,以下就对VB的数据库编程方式做一个简单剖析。1. DAO技术通过 Microsoft 的 Jet Database EngingJet 数据库引擎),DAO(Data Access Object) 技术主要提供对ISAM (顺序索引查找方法)类型数据库的访问,如实现对 FoxPro, Access, Dbase等数据库的访问。1.1使用Data控件D

28、ata控件是利用工具箱中的“Data”按钮产生的。该控件有3个基本属性:Connect, Database Name和Record Sources其中Connect属性确定数据控件要访问的数据库类 型,默认为Access数据库,Database Name属性的值为包含完整路径的数据库文件名, Record Source属性值为要访问的记录集,可以是表,也可是 SQL语句。如访问D盘 TEMP文件夹下的teacher mdb数据库文件中的表stud,贝U Data控件的Connect属 性为空,Database Name属 性为 “ D: temp teacher mdb”,Record Sou

29、rce属 性值 为“ stud”。这样就实现了 Data控件和数据库记录之间的数据绑定,通过调用Data控件的Add new,Update, Delete,Move last等方法实现对数据库的各种访问要求, 在进行数据库内容浏览时,Data控件还经常和DBGrid控件配合使用,提供网格方式 的数据查询。1.2利用DAO对象库DAO对象库的模型主要采用层次结构,Dentine是最高层的对象,下面有 Errors 和workspace两个对象集合,在workspace对象下是Databases集合。在应用程序引用 DAO对象库时,只会产生一个Dbengine对象,并自动生成一个默认的工作空间对象

30、 workspace,在没有另外指定的情况下,所有的数据库操作都是在默认工作区 workspace(O中执行的,但要注意:Jet引擎在VB启动后不会自动装入,只有在Project 菜单项中选择 References然后选中Microsoft DAO 3.5 Object Library才可以使用。在DAO中使用Create Database方法创建数据库,用 Create Table方法创建表, 用Open Database方法打开指定的数据库,用 Open record se方法打开记录集,使用 recordset对象的 Add new, Update, Delete, Move first

31、, Edit 等方法可实现对表的各 种操作。2. RDO技术RDO是提供对关系型ODBC数据源访问的接口。当需要访问其他数据库如SQL Server, Oracle时,特别是需要建立客户/服务器应用程序时,可使用远程数据控件 RDC( Remote Data Control)和远程数据对象 RDO(Remote Data Control)通过 ODBC 驱动程序来实现对数据库的访问。使用ODBC访问某数据库时必须先安装相应的驱动程序,建立一个数据源,通过指定的数据源访问相应的数据库。建立 ODBC数据源是打开“控制面板”窗口,双 击ODBC管理程序的图标,在打开的 ODBC数据源管理器对话框中

32、单击“ Add”按 钮创建数据源,并选择对应的数据库名。2.1使用RDC控件与DATA控件在使用上很类似,用Data Source Name属性指定控件绑定的数据源 名,用SQL属性指定记录集,不同的是,在 RDC控件的SQL属性中必须采用SQL 语句指定。在数据库浏览时也经常与 DBGrid控件联合使用。2.2使用RDO对象库在使用RDO对象之前,应在Project菜单项中选择References选中“ Microsoft Remote Data Object 2.0 后才可以使用。使用RDO访问ODBC数据源的步骤是:1)设置一个RDO环境对象2)用Open Connection方法打开一

33、个 ODBC数据源3)用Open ResultSet方法建立结果对象4)利用给定的方法,对结果集中的记录进行各种操作。3. ADO技术ADO(ActiveX Data Objects)是微软最新的数据访问技术,它采用通用数据访问 接口 UDA (Universal Data Access,将所有的数据规范为一种数据源,经过OLEDB接口的过滤,以相同的方式转换成一种通用的数据格式,使应用程序能访问这种数据。 OLEDB是一个低层的数据访问接口,用它可以访问各种数据源,包括传统的关系型 数据库,以及电子邮件系统及自定义的商业对象。3.1使用ADO控件在Project菜单中单击 Component

34、s命令,在Components对话框中选中“ Microsoft ADO Data Control 6.0(OLEDB) ”,可将ADO控件添加到控件箱中。迪过ADO控件的Connection string属性设置 OLEDB Provider和指定的数据库文 件,Record Source属性设置ADO控件相连的记录源。与 DAO和RDO类似,通过 ADO控件与记录源的连接,可实现对各种数据库的快速访问。3.2使用ADO对象库在Project菜单中单击 References命令,在 References对话框中选中“ MicrosoftActiveX Data Objects 2.0 Lib

35、rary ”,可在工程中添加对 ADO 对象库的引用。以前的对象模型,如 DAO 和 RDO 都是层次型的,一个较低的数据对象如 Record set是几个较高层次的对象如 Environment和Queried的子对象。但ADO却不同,它 定义了一组平面型顶级对象,最重要的 3个ADO对象是Connection. Record set和 Command。Co nn ection对象用于建立应用程序和数据源的连接; Comma nd对象用于定义一个 SQL语句、一个存储过程或其他对数据进行操作的命令, Record set对象保存执行命 令后返回的记录集。通过调用Record set对象的其他

36、方法,可实现对记录集的修改、删除、查询等操作。4. 结语VB 提供了很多方法实现对数据库的操作,其中 DAO 主要实现对 ISAM 数据库 的访问, RDO 提供对 ODBC 数据源的接口, RDO 和 DAO 都已发展为相当成熟的 技术。在VB 6.0之前是主要的数据库访问技术,而 Active Data Objects(ADO)作为微 软推出的新一代数据库接口,被设计同新的数据访问层 OLEDB Provider 一起协同工 作,以提供通用数据访问(Universal Data Access,它向VB程序员提供了很多好处, 包括易于使用,熟悉的界面,高速度以及较低的内存占用。由于以上原因,

37、 ADO 将 逐渐代替其他数据访问接口,成为 VB 访问数据库的主要方式。THE DEVELOPMENT 、APPLICATIONS AND BASIC PRINCIPLES OF DATABASEAlong with the social development,humans production and daily life is increasingly inseparable from the information.Whoever has more effective information will be in a stronger competitive position.The

38、 information industry is becoming the backbone of a country.Data,as an information carrier,is gaining increasing attention by people because of its importance of its management tool database to the information technology.Only we own advanced database technology can we manage a array of data effectiv

39、ely,and extract useful information to use.From the late 1960s,the databasesystem has been developed during 30 years,two generations of evolution.The first-generation database system is level with the network database system.The second-generation database system is related database system.During 30 y

40、ears,people mainly devoted themselves to theoretical research and system development of the second-generationdatabasesystem and gained great achievements. Improving related theory establishment marked the improve of the related database system theory.Commercialization of DB2,INGRES,ORACLS,SYBASE,rel

41、ational databasessuch as SQL SERVER marked that the emergence of relational database system has been reached to top.The first and second-generation database system are designed from commercial transaction processing.Over these years,thesetwo generations of database system is mainly used for banking,

42、the aircraft booking tickets and so on.From the 1980s, We are always exploring the theories, technologies and methods of next generation of database systems.The constant updating of computer hardware,the doubling of their performance,and the communication technology and computer network technology s

43、 rapid development are promoting a big step of the technology of database,and make a revolutionary change of its applications.The appearanceof the technology of Relational databases,objectdatabases and objects-relation database has solved the problem of data deposition better.How to find a better ap

44、proach which is used for extraction the relevant types of data that users wanted , from the global-scope databases through the Internet / Intranet, this has becomed the main research diretion of information taxonomy (Information systematic IS) which is significant to users.The global major database

45、vendors (Informix,IBM,Oracle,Sybase,Microsoft,etc.) , in order to solve this problem, has picked up some related technologies,by emphasizing the connectivity of Internet, they help users extract and use datas.Among them,the data in warehouse,data market,data mining techniques are considerably advanc

46、ed the development of database management system.1. Data In WarehouseData Warehouse is a concept which tends to a logical concept, it is created based on a number of databases,thesedatabasescan be separated in physical, or even belonging to different countries.Data warehouse break geographical bound

47、aries via the Internet, which union them as a logic synthesis and show the usesr massive databases. Data Warehouse,as a service to enterprise-level application,generally speaking,it provides users with four aspects advantages as followings:a. Reduce the burden of the system and simplify day-to-day m

48、aintenance and managementb. Improve the data integrity, compatibility and effectivenessc. Improve the efficiency of data accessd. Provide simple, unified inquiry and the report form mechanism2. Data Rural FairsThe data warehouse,asan enterprise application,it often involves wide scopes and huge inve

49、stment costs, its construction usually forms as a big project with high investment and slow progress.The department/work teams are not willing to see and accept this.The department/work teams are prefer to acquire open-style data connection tool which fits to own application,easy to use,voluntarily

50、directional,convenient and effective in the company.Compared with the data warehouse,this kind of tool has a closer integration, graphical user interface and more appealing prices.That it is the department/work teams demands make the data rural fair arise in the historic moment.The data rural fair c

51、an be described briefly as:smaller,more centralized.it provided a cheaper way for department/work team to analysis commercial data of the company.The data rural fair should own the characteristics includes:small scale,face the specific application,face the department/work teams,fast realization,smal

52、l scale investment,easy to use,support the heterogeneous machine platform comprehensively and so on.Users may bulid their the data rural fair according to their demands,with their motheds.No matter from the top to downward or from bottom to top,the most important is to guaranteethe dialog between da

53、ta rural fairs, the data rural fair without mutual communication is useless.Moreover, it permits people visit data rural fair via WWW,allows it to provide the data accessingfor more users, and this is also essential.3. Data MiningThe data mining is a kind of new technology which discovers and picks

54、up the hiding data from the database or the data warehouse.It is established on the database,especially on the data warehouse.It also faces the non-specialized users and locates itself in the tabletop,and supports the extemporaneously stochastic inquiry.The data mining technologies can automatically

55、 analysis data,detect and reason them with imagination.It seeks the certain intrinsic connections between data,to excavate the latent, extremely vital patterns which influence the information forecast and the policy-making behavior.It establishes a new service model so that helps the policy-makers t

56、o formulate the market strategy and correct policy-making goal.The data mining technology involves the database, the artificial intelligence (Artificial intelligence, AI),the machine learning,the nerve computation and the statistical analysis and so on.It makes the policy-making support tool (Decisi

57、on Supporting System,DSS) step into a new stage.What about the basic principles of database?4. Information, Data And Data ProcessingWe live in an information world,the information is the direct description by people to the objective world.It will produce massive information when people take part in

58、the activities like politics,the economy,the military,the culture,the education,the science,the art and so on.The information needs to be processedand to be exchanged and to be used. Along with the rapid development of computer technology, the computer has characteristics like high speed handling an

59、d huge storage capacity,which enables the people possiblely preserve and process massive information.In order to record the information,people have used various physical marks and their combinations to express the information,these marks and the combinations are the data.The data is the manifestation of information,the information is the ignificance performance of data.However,data that col

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论