Simple ASP database operation tutorial

Source: Internet
Author: User
ASP database simple operation tutorial. database Connection (used to separate the connection file Conn. ASP) (used to connect users in the BBS/db1/directory. mdb database) display database record principle: displays the records in the database one by one to the client browser, reads each record in the database in sequence, if it is from start to end: Use a loop and determine whether the pointer is used until the end: not Rs. if the EOF is from the end to the header: Use a loop to determine whether the pointer is used until the start: not Rs. bof (contains Conn. ASP is used to open the user under the BBS/db1/directory. mdb database) (message is a data table in the database, that is, the data table where the data you want to display is stored) rs. open sqlstr, Conn, 1, 3 ----> (indicates the way to open the database) rs. movefirst ----> (move the pointer to the first record) while not Rs. EOF ----> (determine whether the pointer ends) response. write (RS ("name") ----> (display the name field in the message table) rs. movenext ----> (move pointer to the next record) Wend ----> (loop end) ---------------------------------------------------- Rs. close Conn. close is used to close the database set rs = nothing set conn = nothing --------------------------------------------------------- %> where the response object is the information sent by the server to the client browser, adding database records to Rs. addnew, Rs. update two functions (including Conn. ASP is used to open the user under the BBS/db1/directory. mdb database) (message is a data table in the database, that is, the data table where the data you want to display is stored) rs. open sqlstr, Conn, 1, 3 ----> (indicates the way to open the database) rs. addnew adds a new record RS ("name") = "XX" to pass the value of XX to the name field Rs. update and refresh the database -------------------------------------------------- Rs. close Conn. close is used to close the database set rs = nothing set conn = nothing ----------------------------------------------------------- %>. RS is used to delete a record and delete a database record. delete, Rs. update (including Conn. ASP is used to open the user under the BBS/db1/directory. mdb database) (message is a data table in the database, that is, the data table where the data you want to display is stored) rs. open sqlstr, Conn, 1, 3 ----> (indicates the way to open the database) ----------------------------------------------------- while not Rs. EOF if RS. ("name") = Name then Rs. delete Rs. whether the value of the Name field in the update query data table is equal to the value of the variable name "XX". If yes, delete the data. Otherwise, else continues the query until the end of the pointer. movenext EMD if Wend -------------------------------------------------------------------------------------------------------- Rs. close Conn. close is used to close the database set rs = nothing set conn = nothing --------------------------------------------------------- %> the query field for database query (a) is Numeric (B). The query field is Numeric %>

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.