Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > General global.asa failure

Reply
Thread Tools

General global.asa failure

 
 
Mikael Hellström
Guest
Posts: n/a
 
      04-29-2004
Hi, I have some huge problem. I fell sick for several days because of this
global.asa file problem

This is my problem:
I don't have any problem what so ever home on my local computer. Everything
work like a dream.
But on the webhotell nothing seems to be ok. It seems like session OnEnd
nerver execute..?
I have done the following tests.

1) SUB Application_OnStart will run because Application("namn") give me the
value "test" so will the function
Session_OnStart
2) I have put this code in session OnEnd
response.redirect(http://www.someurl.com) but it wont redirect me
to that url.
3) I have tryed to replace the code strSQL="delete from online where
medlemsNr=" & session("medlemsNr")
to strSQL="delete from online where medlemsNr=100000" dont work!!!

Soo as i can see it Session OnEnd is never called Why??
I'm on a Window IIS account and use a Microsoft sql server 2000

Regards Mikael



======================== My global.asa =====================================


<SCRIPT LANGUAGE=VBScript RUNAT=Server>

SUB Application_OnStart
Application("aktivanu") = 0
Application("namn") = "test"
END SUB

SUB Session_OnStart
Session.Timeout = 10
application.Lock
application("aktivanu") = Application("aktivanu") + 1
application.Unlock
END SUB

SUB Session_OnEnd
application.Lock
application("aktivanu") = Application("aktivanu") - 1
application.Unlock

strCon = connectionStr="Driver={SQL
Server};Server=mssql.webbhotellsgruppen.se;Uid=XXX X;Pwd=XXXXX;Database=XXXXX
XDB;"

Dim objConn ' ADO Recordset Object
Dim objRS ' ADO Connection Object
Dim strSQL

Set objConn = Server.CreateObject("ADODB.Connection")
objConn.ConnectionString=strCon
objConn.Open

strSQL="delete from online where medlemsNr=" & session("medlemsNr")
objConn.Execute strSQL

End sub

</script>

<OBJECT
RUNAT="Server"
SCOPE="Application"
ID="ChatUsers"
PROGID="Scripting.Dictionary">
</OBJECT>

<OBJECT
RUNAT="Server"
SCOPE="Application"
ID="conquerChatRooms"
PROGID="Scripting.Dictionary">
</OBJECT>

<OBJECT
RUNAT="Server"
SCOPE="Application"
ID="ChatMessages"
PROGID="Scripting.Dictionary">
</OBJECT>


 
Reply With Quote
 
 
 
 
Kris Eiben
Guest
Posts: n/a
 
      04-29-2004
Read:
http://www.aspfaq.com/show.asp?id=2078

"Mikael Hellström" <(E-Mail Removed)> wrote in message
news:jZ5kc.91151$(E-Mail Removed)...
> Hi, I have some huge problem. I fell sick for several days because of

this
> global.asa file problem
>
> This is my problem:
> I don't have any problem what so ever home on my local computer.

Everything
> work like a dream.
> But on the webhotell nothing seems to be ok. It seems like session

OnEnd
> nerver execute..?
> I have done the following tests.
>
> 1) SUB Application_OnStart will run because Application("namn") give

me the
> value "test" so will the function
> Session_OnStart
> 2) I have put this code in session OnEnd
> response.redirect(http://www.someurl.com) but it wont redirect me
> to that url.
> 3) I have tryed to replace the code strSQL="delete from online where
> medlemsNr=" & session("medlemsNr")
> to strSQL="delete from online where medlemsNr=100000" dont work!!!
>
> Soo as i can see it Session OnEnd is never called Why??
> I'm on a Window IIS account and use a Microsoft sql server 2000
>
> Regards Mikael
>
>
>
> ======================== My global.asa

=====================================
>
>
> <SCRIPT LANGUAGE=VBScript RUNAT=Server>
>
> SUB Application_OnStart
> Application("aktivanu") = 0
> Application("namn") = "test"
> END SUB
>
> SUB Session_OnStart
> Session.Timeout = 10
> application.Lock
> application("aktivanu") = Application("aktivanu") + 1
> application.Unlock
> END SUB
>
> SUB Session_OnEnd
> application.Lock
> application("aktivanu") = Application("aktivanu") - 1
> application.Unlock
>
> strCon = connectionStr="Driver={SQL
>

Server};Server=mssql.webbhotellsgruppen.se;Uid=XXX X;Pwd=XXXXX;Database=X
XXXX
> XDB;"
>
> Dim objConn ' ADO Recordset Object
> Dim objRS ' ADO Connection Object
> Dim strSQL
>
> Set objConn = Server.CreateObject("ADODB.Connection")
> objConn.ConnectionString=strCon
> objConn.Open
>
> strSQL="delete from online where medlemsNr=" & session("medlemsNr")
> objConn.Execute strSQL
>
> End sub
>
> </script>
>
> <OBJECT
> RUNAT="Server"
> SCOPE="Application"
> ID="ChatUsers"
> PROGID="Scripting.Dictionary">
> </OBJECT>
>
> <OBJECT
> RUNAT="Server"
> SCOPE="Application"
> ID="conquerChatRooms"
> PROGID="Scripting.Dictionary">
> </OBJECT>
>
> <OBJECT
> RUNAT="Server"
> SCOPE="Application"
> ID="ChatMessages"
> PROGID="Scripting.Dictionary">
> </OBJECT>
>
>



 
Reply With Quote
 
 
 
 
Mikael Hellström
Guest
Posts: n/a
 
      04-29-2004
Hi all,
Ok i will do like this:
When the people logg on to my site i set the time in a table and
use their member id as key.
Everypage they visit i update this table with a new time.
Fine...Now i nead some help with a stored procedure. I Have never
tryed to write some...
I ned some form of job done can i use a timer so the procedure is called by
the server in
some intervall???

Please can u help me with a code snip or thell me where i can read about
this!
Regards Mikael

"Kris Eiben" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Read:
> http://www.aspfaq.com/show.asp?id=2078
>
> "Mikael Hellström" <(E-Mail Removed)> wrote in message
> news:jZ5kc.91151$(E-Mail Removed)...
> > Hi, I have some huge problem. I fell sick for several days because of

> this
> > global.asa file problem
> >
> > This is my problem:
> > I don't have any problem what so ever home on my local computer.

> Everything
> > work like a dream.
> > But on the webhotell nothing seems to be ok. It seems like session

> OnEnd
> > nerver execute..?
> > I have done the following tests.
> >
> > 1) SUB Application_OnStart will run because Application("namn") give

> me the
> > value "test" so will the function
> > Session_OnStart
> > 2) I have put this code in session OnEnd
> > response.redirect(http://www.someurl.com) but it wont redirect me
> > to that url.
> > 3) I have tryed to replace the code strSQL="delete from online where
> > medlemsNr=" & session("medlemsNr")
> > to strSQL="delete from online where medlemsNr=100000" dont work!!!
> >
> > Soo as i can see it Session OnEnd is never called Why??
> > I'm on a Window IIS account and use a Microsoft sql server 2000
> >
> > Regards Mikael
> >
> >
> >
> > ======================== My global.asa

> =====================================
> >
> >
> > <SCRIPT LANGUAGE=VBScript RUNAT=Server>
> >
> > SUB Application_OnStart
> > Application("aktivanu") = 0
> > Application("namn") = "test"
> > END SUB
> >
> > SUB Session_OnStart
> > Session.Timeout = 10
> > application.Lock
> > application("aktivanu") = Application("aktivanu") + 1
> > application.Unlock
> > END SUB
> >
> > SUB Session_OnEnd
> > application.Lock
> > application("aktivanu") = Application("aktivanu") - 1
> > application.Unlock
> >
> > strCon = connectionStr="Driver={SQL
> >

> Server};Server=mssql.webbhotellsgruppen.se;Uid=XXX X;Pwd=XXXXX;Database=X
> XXXX
> > XDB;"
> >
> > Dim objConn ' ADO Recordset Object
> > Dim objRS ' ADO Connection Object
> > Dim strSQL
> >
> > Set objConn = Server.CreateObject("ADODB.Connection")
> > objConn.ConnectionString=strCon
> > objConn.Open
> >
> > strSQL="delete from online where medlemsNr=" & session("medlemsNr")
> > objConn.Execute strSQL
> >
> > End sub
> >
> > </script>
> >
> > <OBJECT
> > RUNAT="Server"
> > SCOPE="Application"
> > ID="ChatUsers"
> > PROGID="Scripting.Dictionary">
> > </OBJECT>
> >
> > <OBJECT
> > RUNAT="Server"
> > SCOPE="Application"
> > ID="conquerChatRooms"
> > PROGID="Scripting.Dictionary">
> > </OBJECT>
> >
> > <OBJECT
> > RUNAT="Server"
> > SCOPE="Application"
> > ID="ChatMessages"
> > PROGID="Scripting.Dictionary">
> > </OBJECT>
> >
> >

>
>



 
Reply With Quote
 
CJM
Guest
Posts: n/a
 
      04-30-2004
..sqlserver.programming and/or .asp.db would be good places to ask this
question.

Note: You dont want to delete peoples session data xx minutes after they
have joined your site. You want to remove them xx minutes after their last
action - therefore every page will need to update the db with the time that
the user calls the page:

'Update Sessions Set LastAccessed = GetDate()'

Then your clearup code would then check for sessions that hadnt been used in
xx minutes.

hth

CJM

"Mikael Hellström" <(E-Mail Removed)> wrote in message
news:fjbkc.91178$(E-Mail Removed)...
> Hi all,
> Ok i will do like this:
> When the people logg on to my site i set the time in a table and
> use their member id as key.
> Everypage they visit i update this table with a new time.
> Fine...Now i nead some help with a stored procedure. I Have never
> tryed to write some...
> I ned some form of job done can i use a timer so the procedure is called

by
> the server in
> some intervall???
>
> Please can u help me with a code snip or thell me where i can read about
> this!
> Regards Mikael
>
> "Kris Eiben" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > Read:
> > http://www.aspfaq.com/show.asp?id=2078
> >
> > "Mikael Hellström" <(E-Mail Removed)> wrote in message
> > news:jZ5kc.91151$(E-Mail Removed)...
> > > Hi, I have some huge problem. I fell sick for several days because of

> > this
> > > global.asa file problem
> > >
> > > This is my problem:
> > > I don't have any problem what so ever home on my local computer.

> > Everything
> > > work like a dream.
> > > But on the webhotell nothing seems to be ok. It seems like session

> > OnEnd
> > > nerver execute..?
> > > I have done the following tests.
> > >
> > > 1) SUB Application_OnStart will run because Application("namn") give

> > me the
> > > value "test" so will the function
> > > Session_OnStart
> > > 2) I have put this code in session OnEnd
> > > response.redirect(http://www.someurl.com) but it wont redirect me
> > > to that url.
> > > 3) I have tryed to replace the code strSQL="delete from online where
> > > medlemsNr=" & session("medlemsNr")
> > > to strSQL="delete from online where medlemsNr=100000" dont work!!!
> > >
> > > Soo as i can see it Session OnEnd is never called Why??
> > > I'm on a Window IIS account and use a Microsoft sql server 2000
> > >
> > > Regards Mikael
> > >
> > >
> > >
> > > ======================== My global.asa

> > =====================================
> > >
> > >
> > > <SCRIPT LANGUAGE=VBScript RUNAT=Server>
> > >
> > > SUB Application_OnStart
> > > Application("aktivanu") = 0
> > > Application("namn") = "test"
> > > END SUB
> > >
> > > SUB Session_OnStart
> > > Session.Timeout = 10
> > > application.Lock
> > > application("aktivanu") = Application("aktivanu") + 1
> > > application.Unlock
> > > END SUB
> > >
> > > SUB Session_OnEnd
> > > application.Lock
> > > application("aktivanu") = Application("aktivanu") - 1
> > > application.Unlock
> > >
> > > strCon = connectionStr="Driver={SQL
> > >

> > Server};Server=mssql.webbhotellsgruppen.se;Uid=XXX X;Pwd=XXXXX;Database=X
> > XXXX
> > > XDB;"
> > >
> > > Dim objConn ' ADO Recordset Object
> > > Dim objRS ' ADO Connection Object
> > > Dim strSQL
> > >
> > > Set objConn = Server.CreateObject("ADODB.Connection")
> > > objConn.ConnectionString=strCon
> > > objConn.Open
> > >
> > > strSQL="delete from online where medlemsNr=" & session("medlemsNr")
> > > objConn.Execute strSQL
> > >
> > > End sub
> > >
> > > </script>
> > >
> > > <OBJECT
> > > RUNAT="Server"
> > > SCOPE="Application"
> > > ID="ChatUsers"
> > > PROGID="Scripting.Dictionary">
> > > </OBJECT>
> > >
> > > <OBJECT
> > > RUNAT="Server"
> > > SCOPE="Application"
> > > ID="conquerChatRooms"
> > > PROGID="Scripting.Dictionary">
> > > </OBJECT>
> > >
> > > <OBJECT
> > > RUNAT="Server"
> > > SCOPE="Application"
> > > ID="ChatMessages"
> > > PROGID="Scripting.Dictionary">
> > > </OBJECT>
> > >
> > >

> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
General....very general.... no important for u forever hi Python 0 03-18-2009 08:21 AM
Success Or Failure: There Is No Such Thing As Failure bs866806@163.com C Programming 0 01-06-2008 11:41 AM
HEXUS.interview: Tony Riccardi, Mesh General Manager Silverstrand Front Page News 0 07-27-2005 08:26 PM
Re: PopeSystem experiences general hardware failure #! Computer Support 0 04-03-2005 07:09 AM
[JAVA] [EVALUATION] - The Java Failure (Sorry: The Java(tm) Failure) Ilias Lazaridis Java 0 02-01-2005 10:32 AM



Advertisments