Global asa refresh

Discussion in 'ASP General' started by K B, Feb 4, 2004.

  1. K B

    K B Guest

    I have an application that loads an array in the global ASA file.
    Sometimes that array gets lost for no real reason, resulting in a ubound
    error. MS has a solution which involves removing virus-scanning and
    backup procedures...which is not an option.

    My question is simple...is there ANY way to force the Global.ASA to
    relaod that array? Currently I have to go in and edit the global.asa,
    add a few spaces and then backspace and save and it causes a reload.

    I could easily check if the variable exists, but if it does not I do not
    know where to go.

    thanks

    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    K B, Feb 4, 2004
    #1
    1. Advertising

  2. K B

    Roy Danon Guest

    I'm not sure i understand what you're saying but i'll give it a try.

    I believe you're using an application variable to store the array,
    When you're using the array on an ASP page Check if the variable isNull, if
    true create the array again on the same page,
    If false, continue.


    Roy.

    "K B" <> wrote in message
    news:%...
    >
    >
    > I have an application that loads an array in the global ASA file.
    > Sometimes that array gets lost for no real reason, resulting in a ubound
    > error. MS has a solution which involves removing virus-scanning and
    > backup procedures...which is not an option.
    >
    > My question is simple...is there ANY way to force the Global.ASA to
    > relaod that array? Currently I have to go in and edit the global.asa,
    > add a few spaces and then backspace and save and it causes a reload.
    >
    > I could easily check if the variable exists, but if it does not I do not
    > know where to go.
    >
    > thanks
    >
    > *** Sent via Developersdex http://www.developersdex.com ***
    > Don't just participate in USENET...get rewarded for it!
     
    Roy Danon, Feb 4, 2004
    #2
    1. Advertising

  3. Use an #include file in the global.asa, and this is where you create your
    array. The #include file looks like this:

    <script language = vbscript runat = server>
    function buildArray()
    dim myArray(2)
    myArray(0) = "a"
    myArray(1) = "b"
    myArray(2) = "c"
    application("myArray") = myArray
    end function
    </script>

    Then in global.asa:

    <script language = vbscript runat = server>
    sub application_onstart()
    buildArray()
    end sub
    </script>

    Then have an #include file, included in EVERY page that will need the array,
    that does this:

    <!--#include file = buildArray.asp -->
    <script language = vbscript runat = server>
    myArray = application("myArray")
    if not isArray(myArray) then buildArray()
    </script>

    Or, you could just rebuild the array on every page that needs it, if it's
    static enough that you just want to rebuild it if it disappears.

    --
    Aaron Bertrand
    SQL Server MVP
    http://www.aspfaq.com/




    "K B" <> wrote in message
    news:#...
    >
    >
    > I have an application that loads an array in the global ASA file.
    > Sometimes that array gets lost for no real reason, resulting in a ubound
    > error. MS has a solution which involves removing virus-scanning and
    > backup procedures...which is not an option.
    >
    > My question is simple...is there ANY way to force the Global.ASA to
    > relaod that array? Currently I have to go in and edit the global.asa,
    > add a few spaces and then backspace and save and it causes a reload.
    >
    > I could easily check if the variable exists, but if it does not I do not
    > know where to go.
    >
    > thanks
    >
    > *** Sent via Developersdex http://www.developersdex.com ***
    > Don't just participate in USENET...get rewarded for it!
     
    Aaron Bertrand - MVP, Feb 4, 2004
    #3
  4. K B

    Chris Barber Guest

    Suggestion:
    Load the array from an XML file and then reload if array ceases to exist of
    the UBound is 0.

    or

    Have a function in an include that loads the array and call function if
    necessary to reload it.

    Chris.

    "K B" <> wrote in message
    news:%...


    I have an application that loads an array in the global ASA file.
    Sometimes that array gets lost for no real reason, resulting in a ubound
    error. MS has a solution which involves removing virus-scanning and
    backup procedures...which is not an option.

    My question is simple...is there ANY way to force the Global.ASA to
    relaod that array? Currently I have to go in and edit the global.asa,
    add a few spaces and then backspace and save and it causes a reload.

    I could easily check if the variable exists, but if it does not I do not
    know where to go.

    thanks

    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    Chris Barber, Feb 4, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Darlene Gauthier

    PostRequestHandlerExecute event in global.asa

    Darlene Gauthier, Jul 23, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    1,444
    Karl Seguin
    Jul 23, 2003
  2. Kevin Spencer

    Re: global.asa file (count sessions)

    Kevin Spencer, Jul 30, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    364
    Kevin Spencer
    Jul 30, 2003
  3. DevBoy

    Global.asa File ?????

    DevBoy, Aug 12, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    371
    Rick Strahl [MVP]
    Aug 13, 2003
  4. Wayne
    Replies:
    2
    Views:
    493
    Wayne
    Nov 11, 2003
  5. Raghu
    Replies:
    1
    Views:
    4,124
    Raghu
    Feb 17, 2005
Loading...

Share This Page