ADO: ActiveX Data Objects

Book description

Getting data across platforms and formats is a cornerstone of present-day applications development. ADO: ActiveX Data Objects is both an introduction and a complete reference to ADO (ActiveX Data Objects), Microsoft's universal data access solution. You'll learn how to easily access data in multiple formats--such as email messages, Access databases, Word documents, and SQL databases--even on different platforms, without spending extra time learning every last detail about each format.Author Jason Roff shows by example how to use ADO with your programming language of choice to save programming time, so you can concentrate on the content and quality of your application rather than the nitty-gritty of specific data formats.ADO: ActiveX Data Objects includes:

  • Chapters dedicated to the Connection, Recordset, Field, and Command objects and the Properties collection
  • A complete, detailed reference listing every ADO object, method, property, and event, in convenient alphabetical order
  • Chapters on ADO architecture, data shaping, the ADO Event Model
  • An appendix containing enumeration tables used by ADO objects and collections, listed alphabetically
  • Brief introductions to RDS, ADO.NET, and SQL
ADO: ActiveX Data Objects is a versatile one-stop guide to both the theory and practice of programming with ADO through Version 2.6. The thorough reference section and topic-specific chapters will help you find quick answers about the details of objects, collections, methods, and properties of ADO. And the abundance of practical code examples will give you a good grasp of how to use ADO's strong points most effectively.

Publisher resources

View/Submit Errata

Table of contents

  1. A Note Regarding Supplemental Files
  2. Preface
    1. Introduction and Organization
      1. Part I: Learning ADO
      2. Part II: Reference Section
      3. Part III: Appendixes
      4. About the Book
      5. Audience
    2. Conventions Used in This Book
    3. Comments and Questions
    4. Acknowledgments
  3. I. Learning ADO
    1. 1. Introduction to ADO
      1. ADO in Context: Universal Data Access
        1. ODBC
          1. Jet/DAO
          2. RDO
          3. ODBCDirect
        2. OLE DB
        3. ADO
        4. RDS
        5. Putting It All Together
      2. ADO and COM: Language Independence
        1. COM
        2. ADO and COM
      3. When to Use ADO
      4. Summary
    2. 2. The ADO Architecture
      1. An Overview of the ADO Architecture
      2. ADO Components
        1. The Connection Object
        2. The Command Object
          1. The Parameters collection and the Parameter object
        3. The Recordset Object
          1. The Fields collection and the Field object
        4. The Record Object
        5. The Stream Object
        6. The Properties Collection and the Property Object
        7. The Errors Collection and the Error Object
      3. Summary
    3. 3. Accessing ADO with Various Languages
      1. Accessing ADO with Visual Basic
        1. Referencing ActiveX Data Objects
        2. Creating ActiveX Data Objects
        3. Using ADO with Visual Basic: An Example
      2. Accessing ADO with Visual C++
        1. Referencing ActiveX Data Objects
        2. Creating ActiveX Data Objects
        3. Using ADO with Visual C++: An Example
      3. Accessing ADO with Visual J++
        1. Referencing ActiveX Data Objects
        2. Creating ActiveX Data Objects
        3. Using ADO with Visual J++: An Example
      4. Accessing ADO with VBScript
        1. Referencing ActiveX Data Objects
        2. Creating ActiveX Data Objects
        3. Using ADO with VBScript: An Example
      5. Accessing ADO with JScript
        1. Referencing ActiveX Data Objects
        2. Creating ActiveX Data Objects
        3. Using ADO with JScript: An Example
      6. Summary
    4. 4. The Connection Object
      1. Opening and Closing a Connection: Implicit Versus Explicit
        1. Opening a Connection
        2. Closing a Connection
      2. Configuring Connections
        1. Working with Connection Strings
        2. Working with Data Source Names
          1. Installing the DSNs
          2. Opening a connection with a DSN
        3. Setting Connection Options
          1. Default database
          2. Data-access permissions
          3. Timeout setting
          4. Cursor location
        4. Determining ADO Version Number and Connection State
      3. Choosing a Data Provider
      4. Executing Commands
        1. The Execute Method
        2. The CommandTimeout Property
      5. Managing Multiple Transactions
        1. Starting a Transaction: The BeginTrans and CommitTrans Methods
        2. Canceling a Transaction: The RollbackTrans Method
        3. Nesting Transactions
        4. Setting Transaction Options
          1. Automatic creation of new transactions
          2. Isolation level
      6. Determining the Layout of Your Data Source
      7. Summary
    5. 5. The Recordset Object
      1. Cursors: Viewing a Recordset
        1. Dynamic Cursor
        2. Keyset Cursor
        3. Static Cursor
        4. Forward-Only Cursor
        5. CursorType Example
      2. Working with Recordsets
        1. The Open Method
        2. The Save Method
        3. Determining the State of the Recordset Object: The State Property
        4. Fine-Tuning Performance of the Recordset Object
          1. The CacheSize property
          2. The MaxRecords property
          3. The CursorLocation property
        5. Sorting, Filtering, and Finding Rows in a Recordset
          1. The Filter property
          2. The Sort property
          3. The Resync method
          4. The Find method
        6. Working with Multiple Recordset Objects
      3. Navigating a Recordset
        1. The Record Pointer
        2. The MoveFirst, MovePrevious, MoveNext, and MoveLast Methods
        3. The Move Example
        4. Ordinal Position
        5. Bookmarks
          1. The Move method
        6. Paging
      4. Working with Records
        1. Adding New Records
        2. Updating and Editing Records
        3. Deleting Records
        4. Retrieving Records
      5. Lock Types: Managing Access to a Recordset
        1. Read-Only Locks
        2. Pessimistic Locks
        3. Optimistic Locks
        4. Batch Optimistic Locks
      6. Summary
    6. 6. Fields
      1. The Fields Collection Object
        1. The Field Object
        2. Working with the Fields Collection
      2. Field Specifics
        1. Field Datatypes
        2. Field Sizes
        3. Large Datatypes
        4. Batch Updates
      3. Determining Field Object Functionality
      4. Summary
    7. 7. The Command Object
      1. Specifying Commands
        1. Textual Definitions as Commands
        2. Stored Procedures as Commands
        3. Table Names as Commands
        4. Unknown Command Types
      2. Executing Commands
        1. Executing Commands with the Command Object
        2. Executing Commands with the Connection Object
        3. Executing Commands with the Recordset Object
      3. Parameters
        1. Passing Parameters
        2. Parameter Properties
        3. Specifying Parameters
      4. The Parameters Project
      5. Asynchronous Execution
        1. Executing a Command Asynchronously
        2. Canceling a Command
      6. Summary
    8. 8. The ADO Event Model
      1. Introduction to Events
      2. The ConnectionEvent Family
        1. Connection Events
        2. Execution Events
        3. Transaction Events
        4. Informational Events
      3. The RecordsetEvent Family
        1. Retrieval Events
        2. Movement Events
        3. Field Change Events
        4. Record Change Events
        5. Recordset Change Events
      4. Canceling Operations
      5. Turning Events Off
      6. Summary
    9. 9. Data Shaping
      1. An Introduction to Data Shaping
      2. The Microsoft Data Shaping Service
      3. Shaping Commands
        1. APPEND Command
        2. COMPUTE Command
        3. Shape Functions
      4. Example: Accessing Shaped Recordsets
      5. Summary
    10. 10. Records and Streams
      1. The Record Object
        1. Opening a Record Object
          1. Opening a Record object with a Command object
          2. Opening a Record object with a SQL statement
          3. Opening a Record object with a table name
          4. Opening a Record object with an open Recordset object
          5. Opening a Record object with a URL
        2. Navigating Hierarchies
        3. File and Directory Manipulation with the Record Object
          1. Copying
          2. Deleting
          3. Moving
        4. Record Object Properties
        5. Record Object Fields
          1. Internet Publishing provider fields
          2. Standard Record object fields
      2. The Stream Object
        1. Opening a Stream Object
          1. Obtaining a Stream with the Default Stream from a Record object
          2. Opening a Stream with an open Record object
          3. Opening a Stream with an absolute URL
          4. Opening a Stream in memory
        2. Reading and Writing with Streams
          1. Textual data
          2. Binary data
          3. Stream persistence
      3. Summary
    11. 11. Remote Data Services
      1. RDS Object Model
        1. The DataSpace Object
          1. DataSpace object members
          2. Instantiating an object with the DataSpace object
        2. The DataFactory Object
          1. DataFactory object members
          2. Creating an empty recordset on the client side
          3. Roundtrip querying and updating
        3. The DataControl Object
          1. DataControl object members
          2. Binding a control to the DataControl object
          3. Filtering and sorting the recordset
      2. An Example in RDS
      3. More Information About RDS
      4. Summary
    12. 12. The Microsoft .NET Framework and ADO.NET
      1. The Microsoft .NET Framework
        1. The Common Language Runtime
        2. C#: Unified Programming Language
        3. ASP.NET
        4. From COM to .NET: The Creation of ADO.NET
      2. ADO.NET
        1. DataSets
        2. Managed Providers
      3. ADO.NET Features
        1. Disconnected Data
        2. Strongly Typed Language
        3. XML Integration
      4. Summary
  4. II. Reference Section
    1. 13. ADO API Reference
      1. Finding the Reference Page
      2. Using the Reference Pages
  5. III. Appendixes
    1. A. Introduction to SQL
      1. Record Selection
        1. Selection Statements
          1. SELECT
          2. SELECT ALL
          3. SELECT DISTINCT
          4. SELECT DISTINCTROW
          5. SELECT TOP
        2. Aggregate Functions
          1. AVG
          2. COUNT
          3. MIN and MAX
          4. STDEV and STDEVP
          5. SUM
          6. VAR and VARP
        3. Setting Conditions
          1. WHERE
          2. WHERE
        4. Grouping and Ordering
          1. GROUP BY
          2. HAVING
          3. ORDER BY
          4. SELECT TOP
        5. Joining Tables
          1. INNER JOIN
          2. LEFT JOIN and RIGHT JOIN
          3. SELECT DISTINCTROW
        6. Subqueries
        7. Unions
          1. UNION
        8. Other Options
          1. PARAMETERS
          2. PROCEDURE
          3. WITH OWNERACCESS OPTION
      2. Data Manipulation
        1. Adding Records
          1. INSERT . . . INTO
        2. Modifying Records
          1. UPDATE
        3. Deleting Records
          1. DELETE
      3. Database Modification
        1. CREATE TABLE
        2. ALTER TABLE
        3. CONSTRAINT
        4. CREATE INDEX
        5. DROP
    2. B. The Properties Collection
      1. The Property Example
    3. C. ADO Errors
      1. Working with Errors in ADO
        1. ADO Trappable Errors
        2. Data-Provider Errors
      2. The Errors Example
        1. The Main Form
        2. The ADO Error(s) Form
    4. D. The ADO Data Control
      1. The ADO Data Control Property Pages
      2. Creating Connection Strings with the ADO Data Control
        1. Data Link Properties Dialog Box
          1. Entering provider information
          2. Entering connection information
            1. The Jet providers
            2. The ODBC provider
            3. The SQL Server providers
            4. The Oracle providers
            5. Other OLE DB providers
          3. Entering advanced information
            1. Impersonation level
            2. Protection level
            3. Connection timeout
            4. Access permissions
          4. Reviewing all of the Data Link information
        2. Data Link Files
      3. The ADO Data Control Example
    5. E. Enumeration Tables
      1. ADCPROP_ASYNCTHREADPRIORITY_ENUM Enumeration — (Versions 2.0, 2.1, 2.5, 2.6)
      2. ADCPROP_AUTORECALC_ENUM Enumeration — (Versions 2.1, 2.5, 2.6)
      3. ADCPROP_UPDATECRITERIA_ENUM Enumeration — (Versions 2.0, 2.1, 2.5, 2.6)
      4. ADCPROP_UPDATERESYNC_ENUM Enumeration — (Versions 2.5, 2.6)
      5. AffectEnum Enumeration — (Versions 2.0, 2.1, 2.5, 2.6)
      6. BookmarkEnum Enumeration — (Versions 2.0, 2.1, 2.5, 2.6)
      7. CommandTypeEnum Enumeration — (Versions 2.0, 2.1, 2.5, 2.6)
      8. CompareEnum Enumeration — (Versions 2.0, 2.1, 2.5, 2.6)
      9. ConnectModeEnum Enumeration — (Versions 2.0, 2.1, 2.5, 2.6)
      10. ConnectOptionEnum Enumeration — (Versions 2.0, 2.1, 2.5, 2.6)
      11. ConnectPromptEnum Enumeration — (Versions 2.0, 2.1, 2.5, 2.6)
      12. CopyRecordOptionsEnum Enumeration — (Versions 2.5, 2.6)
      13. CursorLocationEnum Enumeration — (Versions 2.0, 2.1, 2.5, 2.6)
      14. CursorOptionEnum Enumeration — (Versions 2.0, 2.1, 2.5, 2.6)
      15. CursorTypeEnum Enumeration — (Versions 2.0, 2.1, 2.5, 2.6)
      16. DataTypeEnum Enumeration — (Versions 2.0, 2.1, 2.5, 2.6)
      17. EditModeEnum Enumeration — (Versions 2.0, 2.1, 2.5, 2.6)
      18. ErrorValueEnum Enumeration — (Versions 2.0, 2.1, 2.5, 2.6)
      19. EventReasonEnum — (Versions 2.0, 2.1, 2.5, 2.6)
      20. EventStatusEnum Enumeration — (Versions 2.0, 2.1, 2.5, 2.6)
      21. ExecuteOptionEnum Enumeration — (Versions 2.0, 2.1, 2.5, 2.6)
      22. FieldAttributesEnum Enumeration — (Versions 2.0, 2.1, 2.5, 2.6)
      23. FieldEnum Enumeration — (Versions 2.5, 2.6)
      24. FieldStatusEnum Enumeration — (Versions 2.5, 2.6)
      25. FilterGroupEnum Enumeration — (Versions 2.0, 2.1, 2.5, 2.6)
      26. GetRowsOptionEnum Enumeration — (Versions 2.0, 2.1, 2.5, 2.6)
      27. IsolationLevelEnum Enumeration — (Versions 2.0, 2.1, 2.5, 2.6)
      28. LineSeparatorEnum Enumeration — (Versions 2.5, 2.6)
      29. LockTypeEnum Enumeration — (Versions 2.0, 2.1, 2.5, 2.6)
      30. MarshalOptionsEnum Enumeration — (Versions 2.0, 2.1, 2.5, 2.6)
      31. MoveRecordOptionsEnum Enumeration — (Versions 2.5, 2.6)
      32. ObjectStateEnum Enumeration — (Versions 2.0, 2.1, 2.5, 2.6)
      33. ParameterAttributesEnum Enumeration — (Versions 2.0, 2.1, 2.5, 2.6)
      34. ParameterDirectionEnum Enumeration — (Versions 2.0, 2.1, 2.5, 2.6)
      35. PersistFormatEnum Enumeration — (Versions 2.0, 2.1, 2.5, 2.6)
      36. PositionEnum Enumeration — (Versions 2.0, 2.1, 2.5, 2.6)
      37. PropertyAttributesEnum Enumeration — (Versions 2.0, 2.1, 2.5, 2.6)
      38. RecordCreateOptionsEnum Enumeration — (Versions 2.5, 2.6)
      39. RecordOpenOptionsEnum Enumeration — (Versions 2.5, 2.6)
      40. RecordStatusEnum Enumeration — (Versions 2.0, 2.1, 2.6, 2.6)
      41. RecordTypeEnum Enumeration — (Versions 2.5, 2.6)
      42. ResyncEnum Enumeration — (Versions 2.0, 2.1, 2.5, 2.6)
      43. SaveOptionsEnum Enumeration — (Versions 2.1, 2.5, 2.6)
      44. SchemaEnum Enumeration — (Versions 2.0, 2.1, 2.5, 2.6)
      45. SearchDirectionEnum Enumeration — (Versions 2.0, 2.1, 2.5, 2.6)
      46. SeekEnum Enumeration — (Versions 2.1, 2.5, 2.6)
      47. StreamOpenOptionsEnum Enumeration — (Versions 2.5, 2.6)
      48. StreamReadEnum Enumeration — (Versions 2.5, 2.6)
      49. StreamTypeEnum Enumeration — (Versions 2.5, 2.6)
      50. StreamWriteEnum Enumeration — (Versions 2.5, 2.6)
      51. StringFormatEnum Enumeration — (Versions 2.0, 2.1, 2.5, 2.6)
      52. XactAttributeEnum Enumeration — (Versions 2.0, 2.1, 2.5, 2.6)
  6. Index
  7. Colophon
  8. Copyright

Product information

  • Title: ADO: ActiveX Data Objects
  • Author(s): Jason T Roff
  • Release date: June 2001
  • Publisher(s): O'Reilly Media, Inc.
  • ISBN: 9781565924154