Microsoft ADO and SQL Server Developer's Guide

Joyce Chen and Richard Patterson
Microsoft Corporation

September 1997

Click to open or copy the sample files associated with this technical article.

Introduction

Consistently accessing data within the enterprise is a challenge for today's business applications. Open Database Connectivity (ODBC) provides the first step toward overcoming this challenge by enabling applications to access relational databases. However, as developers and system architects want to include nonrelational data sources and to work in environments such as the Internet, they encounter the dilemma of either developing their own data-access paradigms or working with application program interfaces (APIs) that are incompatible in the new environments. Microsoft® ActiveX™ Data Objects (ADO) along with OLE DB solves this dilemma by providing a single model that works with all data sources in a variety of environments.

ADO provides consistent, high-performance access to data, whether you're creating a front-end database client or middle-tier business object using an application, tool, language, or even an Internet browser. ADO is the single data interface you need to know for one- to n-tier client/server and Web-based, data-driven solution development.

This paper introduces ADO and the ADO programming model for application developers who are targeting Microsoft SQL Server™. Particular attention is given to taking advantage of SQL Server features with ADO, such as stored procedures and server cursors. The concepts presented in the sections titled "The ADO Object Model" and "Using ADO with Microsoft Visual Basic®, Microsoft Visual Basic Scripting Edition (VBScript), Microsoft Visual C++®, and Java" are applicable to all ADO programmers.

Sample Application and Code References

The Microsoft Visual Basic OutputParam project is referenced and included with this paper. The OutputParam project contains examples on how to use the ADO object model with SQL Server. OutputParam contains two files: