Accessibility

ColdFusion Article

 

A Beginner's Guide to Using Stored Procedures with ColdFusion


Table of Contents

The Scenario

As I mentioned in the introduction, in this scenario, you must create a simple web-based employee directory using ColdFusion to access stored procedures that the database administration group of your company created. For security reasons, you must use stored procedures, not direct queries, to access the data from a sensitive personnel database.

For this application, you will create a simple search form to request and match the last name and/or first name, region, or extension number to the company’s employees. If the request finds more than one match, the application displays a list of matching results; from that list, a user can select a name and see the employee details, including a list of territories assigned to that employee.

Setting Up the Database

This tutorial uses the Northwind example database installed by default with Microsoft SQL Server 2000. Use the following steps to set up the data source and import the stored procedures for this tutorial.

  1. In ColdFusion, create a data source named Directory that connects to the Northwind example database. Verify that the connection succeeds.
  2. Open the SQL Server Management Console. Import and run procedures.sql to create the stored procedures in the Northwind example database.