Cls_Cache.asp
上传用户:jisenq
上传日期:2014-06-29
资源大小:7216k
文件大小:2k
源码类别:

数据库编程

开发平台:

ASP/ASPX

  1. <%
  2. Function Pre_Cache_Name
  3. Dim f_Pre_Cache_Name
  4. f_Pre_Cache_Name = Server.MapPath("/"&G_VIRTUAL_ROOT_DIR)
  5. Pre_Cache_Name = LCase(Replace(Replace(f_Pre_Cache_Name,":",""),"",""))
  6. End Function
  7. Function Judge_Cache_Data(f_Sys_Name)
  8. Judge_Cache_Data = Application(Pre_Cache_Name & "_" & LCase(f_Sys_Name) & "_" & "judge")
  9. End Function
  10. Sub Load_Cache(f_Sys_Name,f_Select_Column_Str)
  11. If Judge_Cache_Data(f_Sys_Name) <> "1" Then
  12. Load_Cache_Config f_Sys_Name,f_Select_Column_Str
  13. End If
  14. End Sub
  15. Sub ReLoad_Cache(f_Sys_Name,f_Select_Column_Str)
  16. Load_Cache_Config f_Sys_Name,f_Select_Column_Str
  17. End Sub
  18. Sub Load_Cache_Config(f_Sys_Name,f_Select_Column_Str)
  19. Dim f_Rs,f_Sql,f_App_Name_Str,f_App_Value_Str,Field_Obj
  20. f_Sys_Name = LCase(f_Sys_Name)
  21. f_Sql = "select Top 1 " & f_Select_Column_Str & " From FS_" & f_Sys_Name & "_Config"
  22. Set f_Rs = Server.CreateObject(G_FS_RS)
  23. f_Rs.Open f_Sql,Conn,1,1
  24. If Not f_Rs.Eof Then
  25. If f_Select_Column_Str = "*" Then
  26. Application.Lock
  27. Application(Pre_Cache_Name & "_" & f_Sys_Name & "_" & "judge")="1"
  28. Application.UnLock
  29. Load_Install_Flag("*")
  30. End If
  31. For Each Field_Obj in f_Rs.Fields
  32. f_App_Name_Str = Pre_Cache_Name & "_" & f_Sys_Name & "_" & LCase(Field_Obj.Name)
  33. f_App_Value_Str= f_Rs(Field_Obj.Name)
  34. Application.Lock
  35. Application(f_App_Name_Str)=f_App_Value_Str
  36. Application.UnLock
  37. Next
  38. End If
  39. f_Rs.Close
  40. Set f_Rs = Nothing
  41. End Sub
  42. Sub Load_Install_Flag(f_Sys_Name)
  43. Dim f_Rs,f_Sql
  44. f_Sys_Name = LCase(f_Sys_Name)
  45. If f_Sys_Name = "*" Then
  46. f_Sql = "Select Sub_Sys_ID,Sub_Sys_Installed From FS_MF_Sub_Sys"
  47. Else
  48. f_Sql = "Select Sub_Sys_ID,Sub_Sys_Installed From FS_MF_Sub_Sys Where Sub_Sys_ID ='" & f_Sys_Name & "'"
  49. End If
  50. Set f_Rs = Conn.Execute(f_Sql)
  51. Do While Not f_Rs.Eof
  52. If Not f_Rs.Eof Then
  53. Application.Lock
  54. Application(Pre_Cache_Name & "_" & f_Rs("Sub_Sys_ID") & "_installed")=f_Rs("Sub_Sys_Installed")
  55. Application.UnLock
  56. Else
  57. Application.Lock
  58. Application(Pre_Cache_Name & "_" & f_Rs("Sub_Sys_ID") & "_installed")="0"
  59. Application.UnLock
  60. End If
  61. f_Rs.MoveNext
  62. Loop
  63. f_Rs.Close
  64. Set f_Rs = Nothing
  65. End Sub
  66. Function Get_Cache_Value(f_Sys_Name,f_Column_Str)
  67. If Judge_Cache_Data(f_Sys_Name) <> "1" Then
  68. Call Load_Cache_Config(f_Sys_Name,"*")
  69. End If
  70. Get_Cache_Value = Application(Pre_Cache_Name & "_" & LCase(f_Sys_Name) & "_" & LCase(f_Column_Str))
  71. End Function
  72. %>