Global asa refresh

K

K B

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
 
R

Roy Danon

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.
 
A

Aaron Bertrand - MVP

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.
 
C

Chris Barber

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.



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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,015
Latest member
AmbrosePal

Latest Threads

Top