Updating Global.asa

The global.asa file, coded for the previous version of the Corporate Media Library (CML) application, needs only one small change to work for the critique-enhanced CML. The Application_OnStart subroutine (a subroutine in global.asa), is called when the CML application starts, and it runs the ReadApplicationSettings subroutine to load the values of all the columns from the Settings table of the FmLib database into Application variables. Information stored in the Application variables is available throughout the application and has application scope.

The ReadApplicationSettings subroutine is modified to include the Boolean (True or False) value of the CritiqueEnabled column in the Settings table; the other new settings are added to the Application variables without changing any code. The following code fragment shows how the field names and values are added to the Application variables:

If Not rs.EOF Then
   For Each fld In rs.Fields
      If LCase(fld.Name) = "debug" Then
         '--- Special case for boolean value
         Application("Debug") = (fld.Value = 1)
      ElseIf Not IsNull(fld.Value) Then
         Application(fld.Name) = Trim(fld.Value & "")
      End If
   Next
End If

Other topics on using global.asa include: