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 %>