Adding dynamic images to your website using Dreamweaver
Create a recordset that includes an image-location field
To create a record set with an image-location field:
- Follow the steps in the previous task to add a database that contains an imagelocation field. We’ll work with that database in this exercise.
- Click the Bindings tab in Dreamweaver to access the Bindings panel.
- Click the plus button and choose Recordset (Query) from the pop-up menu to open the Recordset dialog (Figure 2).
Figure 2: To define a recordset, click the plus button on the Bindings panel and select Recordset (Query) from the pop-up menu.
- Click the Advanced button to access the advanced Recordset dialog.
- In the Name field, enter newart, and in the Data Source drop-down list choose cfartgallery2 (or whatever name you gave to the database connection in the preceding task) to select this database as the source of data for the recordset (Figure 3).

(+) view larger
Figure 3: In the Recordset dialog, enter a name for the recordset in the Name field and select a database name from the Data Source dropdown list.
- In the Database Items section, click the plus button to the left of Tables to expand the list of Tables in the cfartgallery2 database. Then click the plus button to the left of ART to access the ART table fields (Figure 4).
Figure 4: In the Database Items section, click the plus button to expand the Tables list, and then click the plus button to expand the ART table. Select the LARGEIMAGE field.
- Select the LARGEIMAGE field and click the SELECT button to add this table field to the SQL statement. The LARGEIMAGE field contains the image file location data.
- If you want to include dynamic text along with the image, choose more fields from the ART and ARTIST tables, which contain additional information about the artworks and the artists. Click the SELECT button to add each one to the SQL statement.
- From the ART table, select the ARTID field and click the ORDER BY button to sort the contents of the recordset by the ARTID value (Figure 5).
Figure 5: In the Database Items section, in the ART table, select the ARTID field. Click the ORDER BY button to sort the recordset results by the ARTID value.
- Click OK to save the recordset and close the advanced Recordset dialog.