ADO: ActiveX Data Objects
|
| List Price: | £34.50 |
| Price: | £21.85 & eligible for FREE Super Saver Delivery on orders over £5. Details |
Availability: Usually dispatched within 24 hours
Dispatched from and sold by Amazon.co.uk
29 new or used available from £3.54
Average customer review:Product 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.N ET, 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.
Product Details
- Amazon Sales Rank: #504491 in Books
- Published on: 2001-06-20
- Original language: English
- Number of items: 1
- Binding: Paperback
- 672 pages
Editorial Reviews
From the Publisher
This book is a one-stop guide to ADO, the universal data access solution from Microsoft that allows easy access to data from multiple formats and platforms. It includes chapters on the Connection, Recordset, Field, and Command objects and the Properties collection; ADO architecture, data shaping, and the ADO Event Model; brief introductions to RDS, ADO.NET, and SQL; and a comprehensive alphabetic reference to every ADO object, method, property, and event.
About the Author
Jason T. Roff has been programming computers since he was eight years old. He has been a programmer and developer for Blockbuster Entertainment and Isogon Corporation, where he quickly worked his way up from client/server developer to senior project leader. He is the author of Visual Basic 5 Database How-To.
Excerpted from ADO: ActiveX Data Objects by Jason T. Roff. Copyright © 2001. Reprinted by permission. All rights reserved.
Chapter 3 - Accessing ADO with Various Languages
Because ActiveX Data Objects expose their properties by means of COM interfaces, they can be accessed by any language that can utilize COM. In this book, we will look at accessing ADO from Visual Basic, Visual C++, and Visual J++, since these are the most commonly used tools for developing ADO applications on the Windows operating system.
In addition to these three languages, there are two scripting languages that are already well-established: VBScript and JScript. VBScript is a lightweight subset of Visual Basic that's designed specifically for adding script to HTML documents. JScript is Microsoft's implementation of JavaScript, designed for script development within HTML documents.
Although ADO is meant to offer the same development interface to each language from which it is accessed, some inconsistencies arise because of differences in their syntax and the development environments in which they are used. In this chapter, we will take a look at each of the five languages and learn how to get started developing ADO applications in each.
Accessing ADO with Visual Basic
Visual Basic is probably the most popular language in which to develop applications for ADO. It is also the language used in the examples and code throughout this book. Visual Basic is a very easy language to understand and excellent for both beginners and advanced developers.
Referencing ActiveX Data Objects
To write an application in Visual Basic using ActiveX Data Objects, you must first tell Visual Basic about them by adding ADO to the list of references that Visual Basic uses to run an application. You may do this by selecting the Project References menu item so that the References dialog box appears.
When redistributing ADO applications, you should use the MDAC redistributable package available for download from Microsoft's web site.
Creating ActiveX Data Objects
In Visual Basic, you can create new ADO objects by simply referencing the ADODB classes of the Microsoft ActiveX Data Objects Library. The following piece of code creates a Connection and a Recordset object in Visual Basic:
' create a reference to a Connection object
Dim con As ADODB.Connection
' create a reference to a Recordset object
Dim rst AS ADODB.Recordset
As with any other Visual Basic objects, you must instantiate them before they can be used, as in the following examples:
' create a new instance of the Connection object
Set con = New ADODB.Connection
' create a new instance of the Recordset object
Set rst = New ADODB.Recordset
In the previous examples, the ADODB prefix to the ADO objects is used in case your Visual Basic development environment references another object of the same class name in a different class library. The following code illustrates how a DAO Recordset and an ADO Recordset can be created within the same project:
' which object model is this from?
Dim rst As Recordset
' explicitly specifying the Data Access Object Model
Dim rstDAO As DAO.Recordset
' explicitly specifying the ActiveX Data Object Model
Dim rstADO As ADODB.Recordset
If you know for a fact that no other class library listed in the References dialog box of your current Visual Basic application has the same class names as ADO, you may remove the ADODB prefix when declaring and instantiating object variables. However, if you are using more than one object model with the same class definitions (as in the previous example), not specifying the library from which the class should be derived tells VB to instantiate the class from the library that comes first in the list of references to the project.
In Visual Basic, it is always a good idea to remove an object from memory once it is no longer being used. This is done by setting the object to Nothing, as follows:
' remove the objects
Set con = Nothing
Set rst = Nothing
Using ADO with Visual Basic: An Example
So that you can visualize how to work with ADO objects in Visual Basic, Example 3-1 uses ADO to open a connection to the Jet Biblio database and to return a recordset containing the names of its first ten authors. Each record is then written to a list box before both the Connection and Recordset objects are closed. Note that the example makes use of dynamic control creation supported by Visual Basic 6.0 or later; if you have an earlier version, simply delete the code that defines, instantiates, and sets the properties of the list box, and place a list box named lstAuthors on the form at design time.
Customer Reviews
Absolutely Great Book
If you are using ADO then this book is a must. I use a lot of VBA to connect Excel with data held in an Oracle database and this has been a godsend.
This book not only takes you through everything you would ever want to know about ADO (without sending you to sleep) but goes on to cover advanced stuff like data shaping which is incredibly powerful yet I had never really heard of it.
If you use ADO then this book is a must.



