ADO and Stored Procedures

One of ADO's strong points is its capability to execute SQL Server stored procedures. Using ADO, you can easily pass input parameters to stored procedures and retrieve the values of output parameters. The sections that follow cover the ins and outs of executing stored procedures and responding to the information that they output.

NOTE

The code examples that follow require you to create the associated stored procedures in the NorthWind database prior to running the code.

Executing a Stored Procedure

The easiest way to execute a stored procedure is to use the Command object. Listing 10.13 provides an example.

Listing 10.13. Using the Command Object to Execute a Stored Procedure
 Private Sub cmdNoParms_Click() Dim com As ...

Get Alison Balter's Mastering Access 2002 Enterprise Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.