Data Access  «Prev  Next»

Using parameterized queries

Below is a detailed list of the steps you should have taken to correctly complete the simulation.
  1. Right-click the Recordset DTC.
  2. Select Properties from the menu.
  3. Enter CustRecords in the Name field and click the button to the left of SQL statement.
  4. The completed SELECT statement is shown below with the missing pieces highlighted.
    SELECT CustNo, LName, FName, ADDR1, ADDR2, City, ST, Zip 
    FROM CustTable WHERE ST = ?
    
  5. After completing the statement, click the Implementation tab.
  6. Deselect “Automatically open the Recordset”.
  7. Select the Parameters tab.
  8. Enter txtState in the Value column and click the Close box.
  9. The completed script is shown below with the missing pieces highlighted.
    <%
    dim txtState
    txtState = Request("state")
    CustRecords.open()
    %>
    
  10. After completing the script, right-click anywhere in the source editor.
  11. Select View in browser.
  12. Type AZ in the Search field.