<% SUB CheckRefreshItemCache rem check cache validity once per session per database if 0 = VarType( Session("cache" & Application("dbCache")(Session("DBSOURCE")) ) ) then RefreshItemCache Session("cache" & Application("dbCache")(Session("DBSOURCE"))) = true end if END SUB SUB IncludeItemCache CheckRefreshItemCache Response.Write Application("cache" & Application("dbCache")(Session("DBSOURCE"))) END SUB SUB RefreshItemCache Dim Conn,Comm,RS,cache,cnfg,crlf,Ver,v,Values,i,j,CheckFields,fld,pos,fDoUpd Set Conn = Server.CreateObject("ADODB.Connection") Set Comm = Server.CreateObject("ADODB.Command") Set RS = Server.CreateObject("ADODB.Recordset") Conn.Open Session("DSN") Set Comm.ActiveConnection = Conn Set RS.Source = Comm RS.CursorType = adOpenStatic cache = "cache" & Application("dbCache")(Session("DBSOURCE")) cnfg = "cnfg" & Application("dbCache")(Session("DBSOURCE")) crlf = chr(13) & chr(10) rem check revision # for field item cache Comm.CommandText = "Select FldItemsRev,DefaultVersionNumber from RaidSys where id=1" RS.Open Ver = RS.GetRows() RS.Close Application.Lock if 0 = VarType(Application("fld" & Application("dbCache")(Session("DBSOURCE")))) then Comm.CommandText = "Select DBColName,FriendlyName,XPos,YPos,Width,Height,HelpText,Type,fForcedEntry from flds" RS.Open FldArray = RS.GetRows() RS.Close Application("fld" & Application("dbCache")(Session("DBSOURCE"))) = FldArray end if if 0 = VarType(Application(cnfg)) then fDoUpd = TRUE else if Application(cnfg)(0,0) <> Ver(0,0) then fDoUpd = TRUE end if end if if fDoUpd then Application(cnfg) = Ver rem generate cache file for field items Comm.CommandText = "Select DBColName,FldID,Type,fForcedEntry from flds" RS.Open FldArray = RS.GetRows() RS.Close CheckFields = Array("Status","IssueType","Severity","Priority","Accessibility","Source","HowFound","Lang","Resolution","Cause","CodeChange", "Component", "Software", "Urgency", "Regression", "LangSup", "Processor", "NumCPU") v = "" & crlf Application(cache) = v end if Application.Unlock Conn.Close END SUB %>