Frog Frog Recommended: Use the cache to improve the performance of the ASP program

zhaozj2021-02-12  223

<% class wawa_app_getrowspublic function wawa_get_list (strapp, strconn, strsql) '**** **************************** Function: Extract an array from Application, if the data in Application is an EMPTY value, call WAWA_GET_ROWS () Function to assign the Application. ', You can empty when modifying the database, this will automatically update the Application when you browse,' If you update your database (for example, add, modify or Deleting a data) So after modifying the database, remove the corresponding Application variable, 'Use the following statement to achieve the specified Application value, where the strapp parameter is the Application.contents.Remove (strapp) "Application.contents.Remove (strapp) to be removed.' Application.Contents.remove ****************************************** DIM WAWAWAWA = Application (strapp) if ISempty (WAWA) TENWAWA = WAWA_GET_ROWS (Strconn, Strsql) Application (strapp) = WAWAEND ifwawa_get_list = WAWAEND FUNCTION

Public Function WAWA_GET_ROWS (STRCONN, STRSQL) '************************* Function: Read records from database And use the getRows method 'to save the record into an array' '**************************************************** DIM RS_WAWASET RS_WAWA = CREATEOBJECT "Adodb.recordset") rs_wawa.open strsql, strconn, 1, 1wawa_get_rows = rs_wawa.getRows () rs_wawa.closset gtrows () rs_wawa.closset g_nd class class%> <% dim strapp, strsql, strconnstrapp = "employee" strsql = "SELECT EmployeeID, TitleOfCourtesy, FirstName, LastName, Title, City FROM Employees" strconn = "Driver = {sql server}; server = 192.168.0.110; database = Northwind; uid = sa; pwd = sa; "SET WAWA_TEMP = new WAWA_APP_GETROWSARR_WAWA = WAWA_TEMP.WAWA_GET_LIST (Strapp, StrConn, strsql)%>

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

New Post(0)