


To create the stored procedure, execute the following SQL statement against the database: "CREATE PROC procProductsList AS SELECT * FROM Products " Focusing on the Products table for all of them, let's start off with the easiest one select all data of each row in the table. Using the Northwind database that comes with Access, four stored procedures will be created. At the end of the article I'll show the entire code needed to run these statements against the database. To demonstrate, I'll first show how to create the SQL statements to create stored procedures.

Using stored procedures will make it easier to write the code for the database tier of the application as the program will change very little between the different versions. Consider an application that has to break out into different versions when maintaining both an Access Database and a SQL Server Database. To an Access developer this may sound like unnecessary work to code a query. When a stored procedure is added to an Access Database, the Jet Engine reworks the stored procedure syntax into a query object. The way to get them into your database is to simply code them. Unlike other objects in Access, stored procedures have no interface and cannot be created or run through the Access User Interface. The code in this article has been tested using Access 2002, although it should also work with Access 2000. Part two will demonstrate how to utilize the stored procedures created in part one by assembling a data access tier that can be modelled and used in your own applications. Part one will describe in detail how to create stored procedures in Access using ADO.NET and Visual Basic.NET. This article will be broken down into two parts. However there are some limitations to keep in mind. If you're accustomed to using stored procedures in SQL Server, then you'll be right at home with how they're used in Access.

Stored procedures in Access have been available since Access 2000 and are native to the Jet 4 Database Engine. Stored procedures, a functionality usually associated with enterprise database systems such as SQL Server, can now be found in Access. In the more recent releases of Microsoft Access, great effort has gone into making this product a full-featured relational database system.
