SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 1169 | Next

Joseph W. Lowery

"Dreamweaver CS3 Bible"


To give you a better idea of how the advanced Recordset dialog box is used, look at a step-by-step procedure
used to create the SQL query that returns the results of a user-run search. For this example, suppose
you want to search the LOCATIONS table of dbadata.mdb (an Access database). The search criteria come
from a form element on another page, a text field named searchText; the search criteria are incorporated
into the SQL query as a variable named varSearch. The final query reads as follows:
SELECT ADDRESS, CITY, STATE_COUNTRY
FROM LOCATIONS
WHERE LOCATION_NAME LIKE ???%varsearch%??™
ORDER BY LOCATION_NAME
Here??™s one approach to building this SQL query in the advanced Recordset dialog box:
1. Open the advanced Recordset dialog box by clicking the Add (+) button on the Bindings panel
and choosing Recordset (Query) from the drop-down list.
2. Select the appropriate connection, connDBA.
3. Begin building the SQL query by expanding the Tables tree in the Database Items section, and
then selecting LOCATIONS. Select LOCATION_NAME as the column under LOCATIONS.
4. With LOCATION_NAME highlighted, click SELECT.
Dreamweaver puts the initial part of the query, SELECT LOCATION_NAME FROM LOCTIONS, in
the SQL field.
5. While LOCATION_NAME is still selected, click WHERE.


Pages:
1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181