Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP General (http://www.velocityreviews.com/forums/f65-asp-general.html)
-   -   Global asa refresh (http://www.velocityreviews.com/forums/t793116-global-asa-refresh.html)

K B 02-04-2004 03:09 PM

Global asa refresh
 


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 02-04-2004 03:43 PM

Re: Global asa refresh
 
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" <nottelling@yahoo.com> wrote in message
news:%23C3twDz6DHA.2056@TK2MSFTNGP10.phx.gbl...
>
>
> 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 02-04-2004 03:58 PM

Re: Global asa refresh
 
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" <nottelling@yahoo.com> wrote in message
news:#C3twDz6DHA.2056@TK2MSFTNGP10.phx.gbl...
>
>
> 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 02-04-2004 05:37 PM

Re: Global asa refresh
 
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" <nottelling@yahoo.com> wrote in message
news:%23C3twDz6DHA.2056@TK2MSFTNGP10.phx.gbl...


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!




All times are GMT. The time now is 01:08 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.