毕业论文外文翻译-VB的数据库编程分析.doc
《毕业论文外文翻译-VB的数据库编程分析.doc》由会员分享,可在线阅读,更多相关《毕业论文外文翻译-VB的数据库编程分析.doc(16页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
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
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 毕业论文 外文 翻译 VB 数据库 编程 分析
限制150内