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.
Heres 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