Retrieving information from a page form is a common problem in ASP Programming. However, how long does it take to traverse records passed through the form? This depends on the size of the database. A simple GUI may consume too much time for loop traversal.
For example, assume that a team member logs on to the GUI screen and enters his/her first name, last name, and name, and connects it with a dot: amy. cowen. This value is submitted through the form, and her current project list is retrieved from the database and displayed on the screen. To quickly retrieve user records and display them 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 matching records in the database:
SQL = "SELECT dotname, ID FROM team WHERE dotname = '" & Request. Form ("dotname ")&"'"
If you use the GET method and compare the database record with the field value in QueryString, you can use the same basic method:
SQL = "SELECT dotname, ID FROM team WHERE dotname = '" & Request. QueryString ("dotname ")&"'"
Of course, you can also allocate the value of the 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 &"'"
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service