转至繁体中文版     | 网站首页 | 图文教程 | 资源下载 | 站长博客 | 图片素材 | 武汉seo | 武汉网站优化 | 
最新公告:     敏韬网|教学资源学习资料永久免费分享站!  [mintao  2008年9月2日]        
您现在的位置: 学习笔记 >> 图文教程 >> 软件开发 >> VB.NET程序 >> 正文
DAO Advanced Programming         ★★★★

DAO Advanced Programming

作者:闵涛 文章来源:闵涛的学习笔记 点击数:3916 更新时间:2009/4/23 16:38:42

DAO Advanced Programming

by Dan Haught
Vice President of Product Development

http://www.fmsinc.com

Introduction

Data Access Objects, or DAO, is a powerful programming model for database services. Originally designed as an ODBC layer for Microsoft Visual Basic version 2.0, DAO has evolved into a model that encompasses Microsoft Jet and ODBC, and in the future, OLEDB. This session covers advanced topics in DAO programming that will give you the tools you need to become an advanced programmer using the DAO model.

This session is of primary value to developers creating database applications using Microsoft Access, Microsoft Visual Basic, Microsoft Excel, or Microsoft Visual C++.

Some of the material here is based on work done for the "Microsoft Jet Database Engine Programmers Guide" from Microsoft Press (ISBN 1-55615-877-7). This book is the most complete reference for DAO and Jet programming.

The following topics will be discussed:

  • A Quick Overview of DAO
  • Object Creation and Modification
  • Working with Data
  • Developing an Object Dictionary
  • Semi-Documented Tools and Resources
  • Wrapping Up

Back to Main Technical Papers Page

Copyright 1996 FMS, Inc. All rights reserved

A Quick Overview of DAO

Up until DAO 3.1, DAO was defined as:

"The Programmatic Interface to Microsoft Jet".

Jet is the database engine used by Microsoft Access and Microsoft Visual Basic. DAO has historically been synonymous with Jet, in that Jet was the database engine that it mapped to. As of DAO version 3.1, an important change has occurred. DAO 3.1, through the ODBC-Direct extensions, offers for the first time the ability to completely bypass Microsoft Jet. It is because of this important new functionality that at a conceptual level, DAO is no longer tied to Jet. It is now defined as:

"A Programmatic Interface for Database Services"

Where Can I Use DAO?

DAO is available as a programming tool in to following development environments:

  • Access 2.0
  • Access 95 (version 7)
  • Microsoft Visual Basic (version 4)
  • Microsoft Excel (version 7)
  • Microsoft Visual C++
  • Any development environment that can use an OLE Typelib

How Do I Get DAO?

The DAO components are available in:

  • Access 2.0
  • Access 95 (version 7)
  • Microsoft Visual Basic (version 4)
  • Microsoft Excel (version 7)
  • Microsoft Visual C++ (version 2.01 and later)
  • The DAO SDK ships with the book "Microsoft Jet Database Engine Programmers Guide" from Microsoft Press

How Does DAO Licensing Work?

If your application''''s users have any of the following products installed on their workstations:

  • Microsoft Office 95
  • Visual C++
  • Microsoft Excel version 7
  • Microsoft Access version 7
  • Microsoft Visual Basic version 4 (32-bit)

then they can use both the DAO part of your application and DAO to write their own applications without restrictions. If your application''''s users don''''t have any of these products installed, then they can only use DAO in the context of your application. They cannot use DAO to write their own applications by using the DAO component you ship with your application.

A Brief History of DAO

DAO had its genesis as a part of Visual Basic 2.0 known internally at Microsoft as "VT Objects". This component allowed ODBC access with a very limited set of options. With the November 1992 introduction of Access 1.0, DAO entered version 1.0 status, and allowed Access developers to use a limited set of database objects in a Microsoft Jet database. With version 2.0 of DAO, as introduced by Access 2.0, a much fuller object model was available. There was almost complete control over creating and modifying objects, and opening a variety of recordset types against data. Additionally, the concept of programmatic security control was introduced. The first 32-bit version of DAO was created soon after for the ODBC desktop driver pack introduced by Microsoft. Then, in 1995, DAO 3.0 was introduced with Access 95 and VB4 simultaneously. This version offered a full 32-bit typelib and added new properties and methods to round out the object model. In addition, a new Error object was added to allow easier access to runtime errors. DAO 3.1 was in beta status as of the writing of this paper, and its release date is uncertain. DAO 3.1 represents the first break with Microsoft Jet. Since version 3.1 allows direct access to ODBC data sources through its ODBC-Direct functionality, DAO is no longer only an interface to Jet. In the future, DAO will be the programmatic object model for OLE DB.

The following diagram illustrates the evolution of DAO.

`The Evolution of DAO

Why Use DAO?

DAO is a well-known, easy to use object model for database services, including Microsoft Jet, ODBC, and in the future, OLE DB. DAO is also multi-lingual-you can use it from VB and VBA environments, FoxPro, and Visual C++. Your knowledge of DAO allows you to access a variety of data sources from a variety of development environments. DAO is also Microsoft''''s strategic object model for Database Access. Therefore, you can assume that it is going to be around for a long while.

The DAO Model

DAO is implemented as a hierarchy of objects and collections. Each of the object types is represented within this hierarchy. The following diagram illustrates the model:

The DAO Model

Objects and Collections

Most object types have a collection that acts as a holder for all the objects of that specific type. For example, each the QueryDefs collection holds all QueryDef objects in the database. The following syntax is used to refer to objects in a collection:

Collection!name or Collection![Name]

Collection("name")

Collection(expression) where expression is a variable or other expression

Collection(index) where index is the number of the object''''s position within the collection.

Traversing collections

You can traverse or iterate through a DAO collection

[1] [2] [3] [4] [5]  下一页


[常用软件]Dao ne Deepnet 三合一的浏览器 浏览器  [Web开发]DAO RDO ADO ADO.NET
[Sql Server]ASP编程入门进阶(廿一):DAO SQL之建立数据库表  
教程录入:mintao    责任编辑:mintao 
  • 上一篇教程:

  • 下一篇教程:
  • 【字体: 】【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口
      注:本站部分文章源于互联网,版权归原作者所有!如有侵权,请原作者与本站联系,本站将立即删除! 本站文章除特别注明外均可转载,但需注明出处! [MinTao学以致用网]
      网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)

    同类栏目
    · C语言系列  · VB.NET程序
    · JAVA开发  · Delphi程序
    · 脚本语言
    更多内容
    热门推荐 更多内容
  • 没有教程
  • 赞助链接
    更多内容
    闵涛博文 更多关于武汉SEO的内容
    500 - 内部服务器错误。

    500 - 内部服务器错误。

    您查找的资源存在问题,因而无法显示。

    | 设为首页 |加入收藏 | 联系站长 | 友情链接 | 版权申明 | 广告服务
    MinTao学以致用网

    Copyright @ 2007-2012 敏韬网(敏而好学,文韬武略--MinTao.Net)(学习笔记) Inc All Rights Reserved.
    闵涛 投放广告、内容合作请Q我! E_mail:admin@mintao.net(欢迎提供学习资源)

    站长:MinTao ICP备案号:鄂ICP备11006601号-18

    闵涛站盟:医药大全-武穴网A打造BCD……
    咸宁网络警察报警平台