毕业论文外文翻译-VB的数据库编程分析.doc

上传人:豆**** 文档编号:29955532 上传时间:2022-08-02 格式:DOC 页数:16 大小:143.50KB
返回 下载 相关 举报
毕业论文外文翻译-VB的数据库编程分析.doc_第1页
第1页 / 共16页
毕业论文外文翻译-VB的数据库编程分析.doc_第2页
第2页 / 共16页
点击查看更多>>
资源描述

《毕业论文外文翻译-VB的数据库编程分析.doc》由会员分享,可在线阅读,更多相关《毕业论文外文翻译-VB的数据库编程分析.doc(16页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。

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

2、l use VB as the software development platform.When we use VB to develop the application software,how to use the database and carry on the management of the database is concerned by all exploiters.VB has provided many tools and methods for database programming.What method is used to visit the databas

3、e depends on users different demands,a simple analysis of the VB database programming is explained as followings. 1.DAO Technology By using Microsoft companys Jet Database Engine (Jet database engine),DAO (Data Access Object) the technology mainly provides visit to ISAM (smooth index search method)

4、type database,such as the realization of the visit to database like FoxPro,Access, Dbase. 1.1 Use Data Controls Data controls are produced by using “Data” button in the toolbox.It has 3 basic attributes:Connect,Database Name and RecordSource.Connect attribute specifys the database type that data con

5、trols visit,the default database is the Access database.The value of the Database Name attribute is the database filename which contains the complete path.The Record Source attribute is the recordset that we visit,also can be tables or SQL sentences.If we will visit table stud of database file teach

6、er mdb of TEMP folder under 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 “stud”.This can accomplish the binding between Data controls and database records. Through the methods of Data contro

7、ls like Add new,Update,Delete, Move last,we can visit the database as every request.When we browse the content in database,Data controlls is used frequently with DBGrid,it provides data inquiry in grid way. 1.2 Use DAO Object Storehouse The model of the DAO object storehouse is mainly using hierarch

8、ical structure, Dentine is the object in the topmost story,below it are two object sets,Errors and workspace, under the workspace object,is the Databases set.When the application procedure quotes the DAO object storehouse,it produces only a Dentine object,and produces a default automatical working s

9、pace object named workspace.When not mentioned,all database operations are all work in workspace(0),which is a default work area.But we must pay attention:The Jet engine will not starts automatically after VB has been loaded. Only when we choose References in the menu of Project can we select Micros

10、oft DAO 3.5 Object Library to use.We create databases with the method “Create Database” in DAO,use “CreateTable” method to bulid tables,use the “Open Database ” to open the database ,use “Open recordset”method to open recordset,use Add new,Update,Delete,Move first,Edit methods to realize each kind o

11、f operations about tables. 2.RDO Technology RDO provides a connection to related ODBC data pool.When we need to visit other databases like SQL Server,Oracle,especially to establish the customer/server application procedure,we may use the long range data controls RDC (Remote Data Control) and long ra

12、nge data objects RDO (Remote Data Control) to realize the visit to the database through the ODBC driver. By using ODBC to visit some database we must first install the corresponding drivers,like establish a data pool,through assigned data pool to visit corresponding database.To establish the ODBC da

13、ta pool is open the window of “the control 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 corresponding database. 2.1 Use RDC Controls Similar to the use of DATA Controls, we us

14、e Data source name attributes to assign the data source name that controls bind,and we use SQL attributes to assign the recordset, The difference is that,we have to use the SQL sentences to assign the SQL attribute in RDC Controls . When we browse the database we may find it is used with DBGrid freq

15、uently. 2.2 Use RDO Object Storehouse Before 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 environment object. (2) Open an ODBC data pool with the me

16、thod of Open connection. (3) Establish a result object with the method of Open Result set. (4) Use assigned method to operate the records of resultset. After founds the as this result collection object,is similar with the DAO object storehouse use,may through transfer method realizations and so on i

17、ts Add new,Update, Delete visit to assign the data pool each kind of request. 3.ADO Technology ADO (ActiveX Data Objects) is the latest data access technology of Microsoft,It uses data accessing connection UDA (Universal Data Access),to standard all datas as a kind of data pool,through the filtratio

18、n of OLEDB connection,transforms as a kind of general data format in the same way,enables the application procedure to visit this kind of datas.OLEDB is an underlying level of the data accessing connection,with it we may visit kinds of data pools,including traditional related databases,as well as el

19、ectronic mail system and self-definition commercial object. 3.1 Use ADO Controls Single-click the Components command in the menu of the Project,select “Microsoft ADO Data Control in the Components dialog box 6.0 (OLE DB)”,we may add ADO controls to the box of controls. We set the OLEDB Provider and

20、assigned database file by setting the Connection string attribute of ADO,and 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 ADO Object StorehouseSingle click the References orders

21、in the Project menu, select “Microsoft ActiveX Data Objects 2.0 Library” in the References dialog box, you may 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 level objects like Environment and the Queried. But

22、ADO is actually different, it defined a group of plane top object, the most important ADO objects are Connection, Recordset and Command. The Connection object is used to establish the connection of application procedure and the data pool.The Command object is used in defining a SQL sentence, a memor

23、y process or other commands that operates the datas.Recordset object preserves recordsets after executions. By using alternative means of the recordset object, we can modify,delete and inquire the recordset. 4 Conclusions VB provides many methods to accomplish the operation to the database, in which

24、 DAO mainly finish the visit to ISAM database, RDO provides connection to the ODBC data pool, both RDO and DAO have developed as matured technology.Before VB 6.0 ,the main technology is about database visit, however,the Active Data Objects(ADO) ,as new generation of database interface which is promo

25、ted by Microsoft, is designed to work with new data accessing level OLEDB, so that it provides general data accessing (Universal Data Access), it provides quite a lot advantages to the programmers, including easy use, the familiar contact surface, high velocity ,as well as the lower memory. As a res

26、ult of above reasons, ADO will gradually replace other data accessing connections, and will becomes the fundamental mode of the VB of visit database.VB的数据库编程分析VB(Visual Basic)是微软公司推出的基于Basic语言的可视化编程环境,以其简单易学、功能强大而倍受广大电脑爱好者的青睐。很多应用软件都采用VB作为软件开发平台。在用VB开发应用软件的过程中,如何使用数据库并对数据库进行管理是所有开发者关心的问题。VB为数据库的编程提供

27、了很多的工具和方式,究竟采用何种方式进行数据库的访问依赖于用户的不同需求,以下就对VB的数据库编程方式做一个简单剖析。1.DAO技术 通过Microsoft的Jet Database Engine(Jet 数据库引擎),DAO(Data Access Object)技术主要提供对ISAM(顺序索引查找方法)类型数据库的访问,如实现对FoxPro,Access,Dbase等数据库的访问。 1.1使用Data控件 Data控件是利用工具箱中的“Data”按钮产生的。该控件有3个基本属性:Connect,Database Name和Record Source。其中Connect属性确定数据控件要访问

28、的数据库类型,默认为Access数据库,Database Name属性的值为包含完整路径的数据库文件名,Record Source属性值为要访问的记录集,可以是表,也可是SQL语句。如访问D盘TEMP文件夹下的teachermdb数据库文件中的表stud,则Data控件的Connect属性为空,Database Name属性为“D:tempteachermdb”,Record Source属性值为“stud”。这样就实现了Data控件和数据库记录之间的数据绑定,通过调用Data控件的Add new,Update,Delete,Move last等方法实现对数据库的各种访问要求,在进行数据库内容

29、浏览时,Data控件还经常和DBGrid控件配合使用,提供网格方式的数据查询。 1.2利用DAO对象库 DAO对象库的模型主要采用层次结构,Dentine是最高层的对象,下面有Errors和workspace两个对象集合,在workspace对象下是Databases集合。在应用程序引用DAO对象库时,只会产生一个Dbengine对象,并自动生成一个默认的工作空间对象workspace,在没有另外指定的情况下,所有的数据库操作都是在默认工作区workspace(0)中执行的,但要注意:Jet引擎在VB启动后不会自动装入,只有在Project菜单项中选择References,然后选中Micros

30、oft DAO 3.5 Object Library才可以使用。 在DAO中使用Create Database方法创建数据库,用Create Table 方法创建表,用Open Database方法打开指定的数据库,用Open record set方法打开记录集,使用recordset对象的Add new,Update,Delete,Move first,Edit等方法可实现对表的各种操作。2. RDO技术 RDO是提供对关系型ODBC数据源访问的接口。当需要访问其他数据库如SQL Server,Oracle时,特别是需要建立客户/服务器应用程序时,可使用远程数据控件RDC(Remote Da

31、ta Control)和远程数据对象RDO(Remote Data Control)通过ODBC驱动程序来实现对数据库的访问。 使用ODBC访问某数据库时必须先安装相应的驱动程序,建立一个数据源,通过指定的数据源访问相应的数据库。建立ODBC数据源是打开“控制面板”窗口,双击ODBC管理程序的图标,在打开的ODBC数据源管理器对话框中单击“Add”按钮创建数据源,并选择对应的数据库名。 2.1使用RDC控件 与DATA控件在使用上很类似,用Data Source Name属性指定控件绑定的数据源名,用SQL属性指定记录集,不同的是,在RDC控件的SQL属性中必须采用SQL语句指定。在数据库浏览

32、时也经常与DBGrid控件联合使用。 2.2使用RDO对象库 在使用RDO对象之前,应在Project菜单项中选择References,选中“Microsoft Remote Data Object 2.0”后才可以使用。 使用RDO访问ODBC数据源的步骤是: (1)设置一个RDO环境对象 (2)用Open Connection方法打开一个ODBC数据源 (3)用Open ResultSet方法建立结果对象 (4)利用给定的方法,对结果集中的记录进行各种操作。3. ADO技术 ADO(ActiveX Data Objects)是微软最新的数据访问技术,它采用通用数据访问接口UDA(Unive

33、rsal Data Access),将所有的数据规范为一种数据源,经过OLEDB接口的过滤,以相同的方式转换成一种通用的数据格式,使应用程序能访问这种数据。OLEDB是一个低层的数据访问接口,用它可以访问各种数据源,包括传统的关系型数据库,以及电子邮件系统及自定义的商业对象。 3.1使用ADO控件 在Project菜单中单击Components命令,在Components对话框中选中“Microsoft ADO Data Control 6.0(OLEDB)”,可将ADO控件添加到控件箱中。 通过ADO控件的Connection string属性设置OLEDB Provider和指定的数据库文

34、件,Record Source属性设置ADO控件相连的记录源。与DAO和RDO类似,通过ADO控件与记录源的连接,可实现对各种数据库的快速访问。 3.2使用ADO对象库 在Project菜单中单击References命令,在References对话框中选中“Microsoft ActiveX Data Objects 2.0 Library”,可在工程中添加对ADO对象库的引用。 以前的对象模型,如DAO和RDO都是层次型的,一个较低的数据对象如Record set是几个较高层次的对象如Environment和Queried的子对象。但ADO却不同,它定义了一组平面型顶级对象,最重要的3个AD

35、O对象是Connection, Record set和Command。 Connection对象用于建立应用程序和数据源的连接;Command对象用于定义一个SQL语句、一个存储过程或其他对数据进行操作的命令,Record set对象保存执行命令后返回的记录集。 通过调用Record set对象的其他方法,可实现对记录集的修改、删除、查询等操作。4. 结语VB提供了很多方法实现对数据库的操作,其中DAO主要实现对ISAM数据库的访问,RDO提供对ODBC数据源的接口,RDO 和DAO 都已发展为相当成熟的技术。在VB 6.0之前是主要的数据库访问技术,而Active Data Objects(

36、ADO)作为微软推出的新一代数据库接口,被设计同新的数据访问层OLEDB Provider一起协同工作,以提供通用数据访问(Universal DataAccess),它向VB程序员提供了很多好处,包括易于使用,熟悉的界面,高速度以及较低的内存占用。由于以上原因,ADO将逐渐代替其他数据访问接口,成为VB访问数据库的主要方式。THE DEVELOPMENT 、APPLICATIONS AND BASIC PRINCIPLES OF DATABASEAlong with the social development,humans production and daily life is incr

37、easingly inseparable from the information.Whoever has more effective information will be in a stronger competitive position.The 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 managem

38、ent tool database to the information technology.Only we own advanced database technology can we manage a array of data effectively,and extract useful information to use.From the late 1960s,the database system has been developed during 30 years,two generations of evolution.The first-generation databa

39、se system is level with the network database system.The second-generation database system is related database system.During 30 years,people mainly devoted themselves to theoretical research and system development of the second-generation database system and gained great achievements. Improving relat

40、ed theory establishment marked the improve of the related database system theory.Commercialization of DB2,INGRES,ORACLS,SYBASE,relational databases such as SQL SERVER marked that the emergence of relational database system has been reached to top.The first and second-generation database system are d

41、esigned from commercial transaction processing.Over these years,these two generations of database system is mainly used for banking,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 constan

42、t updating of computer hardware,the doubling of their performance,and the communication technology and computer network technologys rapid development are promoting a big step of the technology of database,and make a revolutionary change of its applications.The appearance of the technology of Relatio

43、nal databases,object databases and objects-relation database has solved the problem of data deposition better.How to find a better approach 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 th

44、e main research diretion of information taxonomy (Information systematic IS) which is significant to users.The global major database vendors (Informix,IBM,Oracle,Sybase,Microsoft,etc.) , in order to solve this problem, has picked up some related technologies,by emphasizing the connectivity of Intern

45、et, they help users extract and use datas.Among them,the data in warehouse,data market,data mining techniques are considerably advanced 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 d

46、atabases,these databases can be separated in physical, or even belonging to different countries.Data warehouse break geographical boundaries 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,gener

47、ally speaking,it provides users with four aspects advantages as followings:a. Reduce the burden of the system and simplify day-to-day maintenance and managementb. Improve the data integrity, compatibility and effectivenessc. Improve the efficiency of data accessd. Provide simple, unified inquiry and

48、 the report form mechanism2. Data Rural FairsThe data warehouse,as an enterprise application,it often involves wide scopes and huge investment 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 directional,convenient and effective in the company.Compared with the data warehouse,this kind of tool has

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 教育专区 > 小学资料

本站为文档C TO C交易模式,本站只提供存储空间、用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。本站仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知淘文阁网,我们立即给予删除!客服QQ:136780468 微信:18945177775 电话:18904686070

工信部备案号:黑ICP备15003705号© 2020-2023 www.taowenge.com 淘文阁