Databases can contain vast amounts of data. Oftentimes, there will be more data in the database than you will want to present to your users. Perhaps there are too many rows to show efficiently, or there is sensitive data—such as credit card information—that you would not want to show to all users who view a page. NetObjects Fusion 12 provides Recordsets to filter the data that is presented to users.
To set a recordset:
In Page view, click on the Record sets button from the DataSources panel.
The DataSources panel displays the Recorsets section.
Click the New Dataset/Variable.. button, and select the Recorset (Query) option.
The Choose a connector dialog appears.
From the Connector drop-down list, select the connector to which you want to create a recordset.
Click the OK button.
The Recordset dialog appears.
On the General tab of the Recorset dialog, there are three main sections:
Select. In this section you define which columns to display. Often a table will have many columns, but you will only want to display a portion of the available columns. NetObjects Fusion 12 provides the ability to restrict the columns displayed to the user to a more manageable level. This allows you to create a more concise presentation of only the information necessary.
Where. In this section you define the where clause. A "Where" clause defines search criteria and returns only those records matching that particular set of criteria. For example, if you had a database containing 10,000 customer records, you could use a Where clause to search for customers who reside in a specific zip code, which in turn, will return only those records meeting that criteria.
The Where clause is not required; however, using a Where clause is recommended. If you have, for example, 10,000 rows of data, it is likely you won't want to return them all. You can use the Where clause to filter your results to a manageable number.
Order by. In this section you can specify which direction to sort the data and which column upon which to base the ordering. The data from the database is displayed in an orderly, but unsorted fashion if no ordering is specified for the Recordset. For example, if you were creating a phone-listing site, you would probably want to default to sorting by last name, ascending. That way, records whose values started with ‘A’ would appear at the top, and records whose values started with ‘Z’ would appear at the bottom.
In the Select list field, click the name of the table you are working with and then click a field that you want to display.
Click the plus sign to add it to the right-hand pane.
In the Where section:
Select a data field from the list of fields in this table. This is the field used to restrict the output.
Choose an operator. An operator is a phrase like "is greater than", or "is equal to".
Choose a value from the drop-down list or type in a custom value. This value can be a field from another recordset, or a variable. If another recordset is used, this has to be used in a Data Source context.
Click the plus sign to add this filter to the right-hand Where pane.
To replace the existing condition, repeat steps 1 through 3, highlight the condition on the right side you want to replace it with, and click the check button.
To add additional conditions, select AND to narrow the query results or OR to broaden the query results, and click the plus sign.
To remove conditions from a where clause, highlight the condition on the right side and click the minus sign.
To order the conditions in a Where clause, use the up and down arrows.
Click OK to close the Recordset editor.
The end result is the creation of a Recordset that describes the data you want to see.