Using ASP online maintenance database

xiaoxiao2021-03-06  67

With the development of the Internet, in the network environment, the database application has gradually developed in the direction of operation and functionality. This article describes how to use ASP technology to implement online maintenance of the database, and give the implementation process of various function keys. Implementation Function Database Administrators can directly maintain the database directly. In the data query and the database maintenance interface (see Figure 1), select the data line to be operated by the check box, and select the operation you want to perform by selecting the function keyway, then press the "Submit" button to perform The required operation and get the return information (see Figure 2) Figure 1 Data query and database maintenance interface Figure 2 Return to the information prompt interface Implementation Environment: Client: Windows 98 Operating System IE 5.0 Browser Server: SQL Server 7.0 Database Website Application Development Environment: Active Server Pages (ASP) Web Making Development Environment: Microsoft FrontPage 2000 Programming First, use the FrontPage 2000 to prepare data queries and database maintenance interfaces, to establish associations with the background SQL Server database Standard, from database tables Data, generate data set RS. To speed up the program access speed, you can save it in the Session object RS1. Part of the code is as follows: <% sql = "select * from informy by pdate dec" set = server.createObject ("adoDb.recordset") rs.open sql, "driver = {SQL Server}; server = (local); Database = info; uid = user; pwd = password; "3, 2 set session (" RS1 ") = RS%> Insert an Form, add" Insert "," Delete "," Modify "and other function keys, and will The group name of the radio button at the function key is set to Edit, and the button value corresponds to "INSERT", "Delete", "Update". Then, write the ASP program TzWh1.asp file. Read the data from the session, separated by the SPLIT function according to the data item, convert it into a array for processing, and remove the data before and after the data is removed with the TRIM function. The program part code is as follows: <% set = session ("RS1") Edit = Trim (Request ("Edit")) ID = "," & TRIM (Request ("ID")) & "," ENO = Split (Trim (Request ("NO"), ",") etitle = split (TRIM ("Title"), ",") ")," "),", ") EWriter = Split (TRIM ("Writer"), ",") Econtent = Split (Trim ("Content"), ",")), ","), ",", ",", ",", "%> Function button. The selection of the function keys is implemented with the CASE statement. During each implementation, the read ENO is compared to the identification number ID of the data item by the INSTR comparison function, which can be identified whether the selected checkbox is valid. The lower boundary of the for cycler uses the UBOUND function to avoid extraction errors for web data.

转载请注明原文地址:https://www.9cbs.com/read-89633.html

New Post(0)