Microsoft ADO and SQL Server Developer's Guide

Joyce Chen and Richard Patterson
Microsoft Corporation

May 1998

Click to copy the sample files associated with this article.

Introduction

Consistently accessing data within the enterprise is a challenge for today's business applications. 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 for developing 1- to n-tier client/server and Web-based, data-driven solutions.

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 Visual Basic, VBScript, Visual C++, and Java" are applicable to all ADO programmers.

Sample Application and Code References

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