首页 > 编程 > .NET > 正文

DAO RDO ADO ADO.NET

2024-07-21 02:08:00
字体:
来源:转载
供稿:网友

ado isn't automatically code-compatible with your existing data access applications. while ado encapsulates the functionality of dao and rdo, you must convert many of the language elements over to ado syntax. in some cases, this will mean only a simple conversion of some functions of your existing code. in other cases, it might be best to rewrite the application using ado's new features.

dao (data access objects) was the first object-oriented interface that exposed the microsoft jet database engine (used by microsoft access) and allowed visual basic developers to directly connect to access tables - as well as other databases - through odbc. dao is suited best for either single-system applications or for small, local deployments.

rdo (remote data objects) is an object-oriented data access interface to odbc combined with the easy-to-use style of dao, providing an interface that exposes virtually all of odbcs low-level power and flexibility. rdo is limited, though, in that it doesn't access jet or isam databases very well, and that it can access relational databases only through existing odbc drivers. however, rdo has proven to be the interface of choice for a large number of sql server, oracle, and other large relational database developers. rdo provides the objects, properties, and methods needed to access the more complex aspects of stored procedures and complex resultsets.

ado is the successor to dao/rdo. functionally ado 2.0 is most similar to rdo, and there's generally a similar mapping between the two models. ado "flattens" the object model used by dao and rdo, meaning that it contains fewer objects and more properties, methods (and arguments), and events. for example, ado has no equivalents to the rdoengine and rdoenvironment objects, which exposed the odbc driver manager and henv interfaces. nor can you currently create odbc data sources from ado, despite the fact that your interface might be through the odbc ole db service provider.

much of the functionality contained in the dao and rdo models was consolidated into single objects, making for a much simpler object model. because of this, however, you might initially find it difficult to find the appropriate ado object, collection, property, method, or event. unlike dao and rdo, although ado objects are hierarchical, they are also creatable outside the scope of the hierarchy.

it should be noted, however, that ado currently doesn't support all of dao's functionality. ado mostly includes rdo-style functionality to interact with ole db data sources, plus remoting and dhtml technology.

in general, it's probably too early in the evolution of ado to migrate most dao applications (except possibly ones using odbcdirect) to ado right now, since ado doesn't currently support data definition (ddl), users, groups, and so forth. if you use dao only for client-server applications and don't rely on the jet database engine or use ddl, however, then you can probably migrate to ado now. eventually, microsoft will provide an ado ddl component to aid in dao-to-ado migration and provide generic ddl support for ole db providers.
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表