Defining the columns of a recordset

Defining the columns of a recordset

You can use SQL to define recordsets for your pages. A recordset is a subset of records extracted from a database. For more information, see About databases.

Here’s the basic SQL syntax to define the columns of a recordset:

SELECT ColumnName1, ColumnName2, ColumnNameX FROM TableName

If you want to include all the columns of a table in the recordset, you can use the wildcard character *, as follows:

SELECT * FROM TableName

For example, suppose you have a table called Customers. To extract all the columns, you would type the following SELECT statement:

SELECT * FROM Customers

Suppose you only need the data contained in two columns of the Customers table: the YearBorn column and the DateLastPurchase column. To create a recordset containing only the data from these two columns, you would type the following SELECT statement:

SELECT YearBorn, DateLastPurchase
FROM Customers


Getting Started with Dreamweaver
Dreamweaver Basics
Working with Dreamweaver Sites
Laying Out Pages
Adding Content to Pages
Working with Page Code
Preparing to Build Dynamic Sites
Making Pages Dynamic
Developing Applications Rapidly