Statement to remove information from a page form is a common problem in ASP programming. But how long does it take to traverse a record that passes through a form? This depends on the size of the database. A simple GUI interface can take too much time on a looping traversal operation.
For example, suppose a team member logs on to the GUI screen and enters his or her first name with a dot connection: Amy.cowen. This value is submitted through the form, and her current project list is taken out of the database and displayed on the screen. To quickly remove a user's record for display on the screen, you can write the following code.
Suppose the HTML page contains the following code:
<form action= "login_post.asp" method= "POST" >
<input type= "text" name= "Dotname" >
<input type= "Submit" >
</FORM>
On your login_post.asp code page you want to read the value of the Dotname field and find the matching record in the database:
SQL = "Select Dotname, ID from team WHERE dotname = '" & Request.Form ("Dotname") & "'"
If you use the Get method, you need to compare the database records with the field values in QueryString, then you can use the same basic method:
SQL = "Select Dotname, ID from team WHERE dotname = '" & Request.QueryString ("Dotname") & "'"
Of course, you can also assign the value of a form field to a variable and insert it into your SQL statement:
Dotname = Request.QueryString ("Dotname")
SQL = "Select Dotname, ID from team WHERE dotname = '" & Dotname & "'"