ADO Examples and Best Practices

In this book review, Danny Lesandrini explores an ADO resource aimed at the experienced ADO user looking to glean additional information on the subject. The author offers a refreshing, light-humored approach that makes for an easy read from what could be considered a very dry subject.

"You're not reading this book for the jokes -- at least, I hope not."

If you have ever heard Bill Vaughn speak at a conference such as VBITS, you appreciate the significance of those opening words from his latest book, ADO Examples and Best Practices, published by Apress. Bill really is a funny guy, which makes reading this book a pleasure. More importantly, though, he has an intimate knowledge of both Visual Basic and Microsoft's Universal Data Access technology. Add to that his 14+ years of experience at Microsoft (most recently as part of the Microsoft Technical Education team), and you have the makings for a great publication.

The book begins with a comprehensive history of the various ADO versions and points out the "gotcha's" associated with upgrades to newer versions of MDAC. Next, Bill briefly explains how to install and deploy ADO. After this quick introduction, he delves into the meat of this best practices feast.

If you're not familiar with the Connection, Command and Recordset objects of ADO, then you would do well to read up on the ADO object model before embarking on this journey. Remember, this is a book on Best Practices, not an ADO tutorial. Some of the interesting points I marked for reference are:

  • Avoid MSDN syntax:   Dim cn As New ADODB.Connection   (pg 37)
  • Always set ConnectionString property first   (pg 15)
  • Always use Native Providers as opposed to ODBC provider   (pg 26)
  • Never reuse Command objects   (pg 76)
  • Avoid the Refresh method like the plague   (pg 88)
  • One of 7 deadly ADO sins:   Do Until rs.EOF ...   (pg 195)
I particularly benefited from the following discussions:
  • Passing Data: Do you really need an ADO recordset?
  • Command Ojbect: The biggest benefit to performance
  • Tips for working with SQL Stored Proceedures.
  • Bill Vaughn's refreshing honesty!   (pg 159- box)
The book also contains more advanced topics, such as ...
  • Data Shaping and ADO
  • Web-based Solutions
  • ADO and the Visual Database Tools
The companion CD for ADO Examples and Best Practices includes the following:
  • The source code used in the book
  • Utilities to help you be more productive
  • Links to other sources of information
One of the utilities that comes with the source code is Bill's Stored Procedure Add-In for VB. This popular little tool has been around since 1999 and is worth the price of admission all by itself. The add-in works from within the Visual Basic environment, automating the process of generating correct code for parameter-based stored procedures. It virtually eliminates the need to guess how to construct the Parameters collection in code.

The verdict
I have to admit I am predisposed to books that focus on best practices. I picked this book up as soon as it hit the store shelves. When the angryCoder extended the offer to write a review, I jumped at the chance. I love this book and would recommend it to any and all of my colleagues who develop Web or desktop applications using ADO.

On the other hand, if you're new to ADO, look elsewhere first. This book isn't a tutorial, and it's not an ADO Reference volume. Definitely not for beginners.

Other recommendations
Hitchhiker's Guide to Visual Basic and SQL Server

This article was originally published on Feb 21, 2002
Page 1 of 1

Thanks for your registration, follow us on our social networks to keep up-to-date