473,893 Members | 1,834 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

global.asa - code outside Subs

In global.asa I have some code outside all the Subs.

I have some confirmation that it is being executed OnStart.
Yet I can's see if it is executed OnEnd.

The literature I have says that OnEnd the Sub Application_OnE nd is executed,
but is does not say that anything else is executed

Actually I even can't understand if global.asa is permited to have any code
outside the Subs

Could someone comment on this?
Jul 19 '05 #1
8 2297
first off, the Application_OnE nd is not reliable....and should not be
counted on.
Beyond that, could you give a specific example of what you are trying to do?

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com
<aa> wrote in message news:u2******** ******@tk2msftn gp13.phx.gbl...
In global.asa I have some code outside all the Subs.

I have some confirmation that it is being executed OnStart.
Yet I can's see if it is executed OnEnd.

The literature I have says that OnEnd the Sub Application_OnE nd is executed, but is does not say that anything else is executed

Actually I even can't understand if global.asa is permited to have any code outside the Subs

Could someone comment on this?

Jul 19 '05 #2
> In global.asa I have some code outside all the Subs.

Could you be more specific? What "code" is "outside all the subs"? Could
you show your global.asa? How do you expect it to be executed? How can you
tell it's being executed OnStart (on start of WHAT) and not OnEnd (again, on
end of WHAT)?
Jul 19 '05 #3
Thank you for asking questions

In global.asa outside all the Subs, I define and initiate a variable to
hold a path to a file to which I write something on Application_OnE nd and
read from on Application_OnS tart. I use MapPath and do it outside Subs
because MapPath for some reason does not work well inside Application
On_End.

My question is: what is the lifetime of that variable? Does it get lost as
soon the global.asa is executed? Or it is stored somewhere?

From my 2 year experience with nt4/iis it seems that it is either stored
like an Application scope variable or (more likely) this out-of-subs code
gets executed OnEnd as well. This is proven that file in question has been
consistently found and records were read from it OnStart and added to it
OnEnd.

The reason I am asking this question is that I moved to w2k server and there
the impression is that the OnEnd event is not fired at all. The log is
registering the times the application starts, but no traces of application
stops

<aa> wrote in message news:u2******** ******@tk2msftn gp13.phx.gbl...
In global.asa I have some code outside all the Subs.

I have some confirmation that it is being executed OnStart.
Yet I can's see if it is executed OnEnd.

The literature I have says that OnEnd the Sub Application_OnE nd is executed, but is does not say that anything else is executed

Actually I even can't understand if global.asa is permited to have any code outside the Subs

Could someone comment on this?

Jul 19 '05 #4
In which sense is it unreliable?
I have been using is on nt4/iis4 for 2 years now to save page hit counters -
it seemed to work fine.
Saving application variables is one of the most common usage of global.asa
and it relies heavily on OnEnd.
The only unreliability I noticed that it is difficult to tell when exactly
this even is expected to fire. But it looks like it had been firing at the
end of the day.
I keep a log on my provider of server down times recording date and time
when thevapplication end and application start - and it has beed quite
consistent.
"Curt_C [MVP]" <software_AT_da rkfalz.com> wrote in message
news:uQ******** *****@TK2MSFTNG P12.phx.gbl...
first off, the Application_OnE nd is not reliable....and should not be
counted on.
Beyond that, could you give a specific example of what you are trying to do?
--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com
<aa> wrote in message news:u2******** ******@tk2msftn gp13.phx.gbl...
In global.asa I have some code outside all the Subs.

I have some confirmation that it is being executed OnStart.
Yet I can's see if it is executed OnEnd.

The literature I have says that OnEnd the Sub Application_OnE nd is

executed,
but is does not say that anything else is executed

Actually I even can't understand if global.asa is permited to have any

code
outside the Subs

Could someone comment on this?


Jul 19 '05 #5
Exactly... most people try to use it for when a person "leaves" the site. As
long as you can wait for the actual session expiration it should work....
They expect the "X" from the browser to fire it, which we all know doesnt'
work

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com
<aa> wrote in message news:OJ******** ******@TK2MSFTN GP12.phx.gbl...
In which sense is it unreliable?
I have been using is on nt4/iis4 for 2 years now to save page hit counters - it seemed to work fine.
Saving application variables is one of the most common usage of global.asa
and it relies heavily on OnEnd.
The only unreliability I noticed that it is difficult to tell when exactly
this even is expected to fire. But it looks like it had been firing at the
end of the day.
I keep a log on my provider of server down times recording date and time
when thevapplication end and application start - and it has beed quite
consistent.
"Curt_C [MVP]" <software_AT_da rkfalz.com> wrote in message
news:uQ******** *****@TK2MSFTNG P12.phx.gbl...
first off, the Application_OnE nd is not reliable....and should not be
counted on.
Beyond that, could you give a specific example of what you are trying to

do?

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com
<aa> wrote in message news:u2******** ******@tk2msftn gp13.phx.gbl...
In global.asa I have some code outside all the Subs.

I have some confirmation that it is being executed OnStart.
Yet I can's see if it is executed OnEnd.

The literature I have says that OnEnd the Sub Application_OnE nd is

executed,
but is does not say that anything else is executed

Actually I even can't understand if global.asa is permited to have any

code
outside the Subs

Could someone comment on this?



Jul 19 '05 #6
Not sure.
You seem to mean Session OnEnd, whereas I mean Application OnEnd

"Curt_C [MVP]" <software_AT_da rkfalz.com> wrote in message
news:uZ******** *****@tk2msftng p13.phx.gbl...
Exactly... most people try to use it for when a person "leaves" the site. As long as you can wait for the actual session expiration it should work....
They expect the "X" from the browser to fire it, which we all know doesnt'
work

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com
<aa> wrote in message news:OJ******** ******@TK2MSFTN GP12.phx.gbl...
In which sense is it unreliable?
I have been using is on nt4/iis4 for 2 years now to save page hit

counters -
it seemed to work fine.
Saving application variables is one of the most common usage of global.asa and it relies heavily on OnEnd.
The only unreliability I noticed that it is difficult to tell when exactly this even is expected to fire. But it looks like it had been firing at the end of the day.
I keep a log on my provider of server down times recording date and time
when thevapplication end and application start - and it has beed quite
consistent.
"Curt_C [MVP]" <software_AT_da rkfalz.com> wrote in message
news:uQ******** *****@TK2MSFTNG P12.phx.gbl...
first off, the Application_OnE nd is not reliable....and should not be
counted on.
Beyond that, could you give a specific example of what you are trying to
do?

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com
<aa> wrote in message news:u2******** ******@tk2msftn gp13.phx.gbl...
> In global.asa I have some code outside all the Subs.
>
> I have some confirmation that it is being executed OnStart.
> Yet I can's see if it is executed OnEnd.
>
> The literature I have says that OnEnd the Sub Application_OnE nd is
executed,
> but is does not say that anything else is executed
>
> Actually I even can't understand if global.asa is permited to have

any code
> outside the Subs
>
> Could someone comment on this?
>
>



Jul 19 '05 #7
My bad... I mis-read it. It's been that type of day....

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com
<aa> wrote in message news:Ou******** ******@TK2MSFTN GP10.phx.gbl...
Not sure.
You seem to mean Session OnEnd, whereas I mean Application OnEnd

"Curt_C [MVP]" <software_AT_da rkfalz.com> wrote in message
news:uZ******** *****@tk2msftng p13.phx.gbl...
Exactly... most people try to use it for when a person "leaves" the site.
As
long as you can wait for the actual session expiration it should work.... They expect the "X" from the browser to fire it, which we all know doesnt' work

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com
<aa> wrote in message news:OJ******** ******@TK2MSFTN GP12.phx.gbl...
In which sense is it unreliable?
I have been using is on nt4/iis4 for 2 years now to save page hit counters -
it seemed to work fine.
Saving application variables is one of the most common usage of

global.asa and it relies heavily on OnEnd.
The only unreliability I noticed that it is difficult to tell when exactly this even is expected to fire. But it looks like it had been firing at the end of the day.
I keep a log on my provider of server down times recording date and time when thevapplication end and application start - and it has beed quite
consistent.
"Curt_C [MVP]" <software_AT_da rkfalz.com> wrote in message
news:uQ******** *****@TK2MSFTNG P12.phx.gbl...
> first off, the Application_OnE nd is not reliable....and should not be > counted on.
> Beyond that, could you give a specific example of what you are
trying to do?
>
> --
> Curt Christianson
> Owner/Lead Developer, DF-Software
> www.Darkfalz.com
>
>
> <aa> wrote in message news:u2******** ******@tk2msftn gp13.phx.gbl...
> > In global.asa I have some code outside all the Subs.
> >
> > I have some confirmation that it is being executed OnStart.
> > Yet I can's see if it is executed OnEnd.
> >
> > The literature I have says that OnEnd the Sub Application_OnE nd is
> executed,
> > but is does not say that anything else is executed
> >
> > Actually I even can't understand if global.asa is permited to have any > code
> > outside the Subs
> >
> > Could someone comment on this?
> >
> >
>
>



Jul 19 '05 #8
Never mind, Curt. What about my original query?

"Curt_C [MVP]" <software_AT_da rkfalz.com> wrote in message
news:eS******** ******@TK2MSFTN GP12.phx.gbl...
My bad... I mis-read it. It's been that type of day....

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com
<aa> wrote in message news:Ou******** ******@TK2MSFTN GP10.phx.gbl...
Not sure.
You seem to mean Session OnEnd, whereas I mean Application OnEnd

"Curt_C [MVP]" <software_AT_da rkfalz.com> wrote in message
news:uZ******** *****@tk2msftng p13.phx.gbl...
Exactly... most people try to use it for when a person "leaves" the site.
As
long as you can wait for the actual session expiration it should work.... They expect the "X" from the browser to fire it, which we all know doesnt' work

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com
<aa> wrote in message news:OJ******** ******@TK2MSFTN GP12.phx.gbl...
> In which sense is it unreliable?
> I have been using is on nt4/iis4 for 2 years now to save page hit
counters -
> it seemed to work fine.
> Saving application variables is one of the most common usage of

global.asa
> and it relies heavily on OnEnd.
> The only unreliability I noticed that it is difficult to tell when

exactly
> this even is expected to fire. But it looks like it had been firing at the
> end of the day.
> I keep a log on my provider of server down times recording date and time > when thevapplication end and application start - and it has beed
quite > consistent.
>
>
> "Curt_C [MVP]" <software_AT_da rkfalz.com> wrote in message
> news:uQ******** *****@TK2MSFTNG P12.phx.gbl...
> > first off, the Application_OnE nd is not reliable....and should not be > > counted on.
> > Beyond that, could you give a specific example of what you are

trying
to
> do?
> >
> > --
> > Curt Christianson
> > Owner/Lead Developer, DF-Software
> > www.Darkfalz.com
> >
> >
> > <aa> wrote in message news:u2******** ******@tk2msftn gp13.phx.gbl... > > > In global.asa I have some code outside all the Subs.
> > >
> > > I have some confirmation that it is being executed OnStart.
> > > Yet I can's see if it is executed OnEnd.
> > >
> > > The literature I have says that OnEnd the Sub Application_OnE nd is > > executed,
> > > but is does not say that anything else is executed
> > >
> > > Actually I even can't understand if global.asa is permited to

have any
> > code
> > > outside the Subs
> > >
> > > Could someone comment on this?
> > >
> > >
> >
> >
>
>



Jul 19 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
2715
by: mrbog | last post by:
I have an array/hash that stores path information for my app. As in, what directory this is in, what directory that's in, what the name of the site is, what the products are called, etc. It's called $glb. So, every function so far looks like this: function something() { global $glb; }
9
2384
by: Tony Johansson | last post by:
Hello! I know it's bad design to use global variables. I just want to ask a question about them. Is global variables and global static variables the same. These are define outside any function at the top of the a file where you have them. //Tony
3
1539
by: Andyza | last post by:
In my Global.asa file I have the following 2 subs for opening and closing my db connection: Sub OpenConn() Dim conn Set conn = Server.CreateObject("ADODB.Connection") conn.Open Application("ConnString") End Sub Sub CloseConn()
22
3820
by: fd123456 | last post by:
Hi Tom ! Sorry about the messy quoting, Google is playing tricks on me at the moment. > Global.asax is where you normally have the Global Application > and Session variables and code to manipulate them. It starts > and ends with <script></script> tags. > > Yours looks like a compiled version of it.
4
1509
by: JohnR | last post by:
My situation is that I have a custom user control that I have built into a DLL and put it on the "USER CONTROLS" part of the toolbox, so I can drag it into a form whenever I need it. The problem is that, for a variety of reasons, I need to "see" a variable in all the SUBs that exist in my user control class that is defined in my startup module of my program. Here's a code snippet: Imports MyUserControlLibrary Module Startup public...
6
1556
by: D. Shane Fowlkes | last post by:
I posted this on another forum, and as I feared, the response(s) were too complex and sophisticated. I certainly don't mind learning new methods, in fact, that's why I asked, but I was hoping to emphasize that needed to take small steps. The responses I received talked about Public Classes and DLLs and such. =( I'm tinkering in ASP.NET 2 (VB) and have been tinkering with VWD for about a couple of weeks. I've written a few app pages...
1
255
by: Brian Cahill | last post by:
Hello, I am trying to create a variable when my form loads which can be used when I click my buttons. Here is my code. What am I doing wrong? Thanks for any help. Private Sub Connect_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load CreateObjConnect() End Sub
9
8678
by: CDMAPoster | last post by:
About a year ago there was a thread about the use of global variables in A97: http://groups.google.com/group/comp.databases.ms-access/browse_frm/thread/fedc837a5aeb6157 Best Practices by Kang Su Gatlin, casual mention was made about using static variables as an alternative to using global variables. This caused me to think of the following: '-----Begin module code
1
29416
weaknessforcats
by: weaknessforcats | last post by:
C++: The Case Against Global Variables Summary This article explores the negative ramifications of using global variables. The use of global variables is such a problem that C++ architects have called it polluting the global namespace. This article explores what happens when the global namespace becomes polluted and how to avoid this condition. The opinions expressed in this article are those of the author alone although many have...
0
9985
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9832
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10839
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10469
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9646
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
8022
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7173
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5858
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
3289
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.