• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL

Lesson 13. Connecting to Data Sources

Lesson 13. Connecting to Data Sources

In Lesson 12, you got your ColdFusion site up and running. You also created a simple ColdFusion application that displayed a variable passed through a Web form from a different page. The real power of a server model such as ColdFusion is its ability to interact with data sources, such as text files, XML documents, and above all, databases. With those data sources, ColdFusion (or ASP, PHP, or JSP) can insert, edit, delete, and/or extract a particular set of data, and output it as if it were standard HTML. This interactivity with a data source enables you to create password-protected pages, surveys, testing environments, message boards, dynamic press release applications, and so forth.

To achieve any of this functionality, you need to define a data source, so ColdFusion knows how to find and communicate with it. Specifically, you will define a Data Source Name, or DSN, in ColdFusion. Lessons 6 and 7 introduced you to the process of defining a Data Source Name in Windows (a method you would use to define a data source for ASP). In this lesson, you will learn how to do the same in ColdFusion, which uses a different interface to accomplish the same thing.

The data displayed in bold was retrieved from a database using a SQL query and displayed on the fly. Add a new profile to the database, and the resulting page would change.


In this lesson, you will:

  • Learn foundational database concepts

  • Create a ColdFusion DSN for your site

  • Build a form that collects biographic information from a user

  • Save the user's form data to a database

  • Build a recordset from a SQL query and display live database data in the browser


This lesson takes approximately 45 minutes to complete.


Media Files:


Starting Files:


Completed Files:





Not a subscriber?

Start A Free Trial

  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint