473,396 Members | 1,858 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Sub Session_OnEnd

cab
i have the following code in the "Sub Session_OnEnd" routine that does not
seem to run.....

Sub Session_OnEnd

strConnect = "Driver={SQL Server};Server=SERVER;Database=database; User
ID=xxxxxx;Pwd=xxxxxxx"

Set objConnEnd = Server.CreateObject("ADODB.Connection")
objConnEnd.Open strConnect

strDelete = "DELETE formdata WHERE formMyCpsID = " & Session.SessionID
objConnEnd.Execute

strDelete objConnEnd.Close
Set objConnEnd = Nothing

End Sub

....can I access the Session.SessionID at this stage or has it already been
killed?

cheers,
cab.
Jul 19 '05 #1
3 3682
cab wrote on 08 jun 2004 in microsoft.public.inetserver.asp.general:
i have the following code in the "Sub Session_OnEnd" routine that does
not seem to run.....

Sub Session_OnEnd

strConnect = "Driver={SQL Server};Server=SERVER;Database=database;
User
ID=xxxxxx;Pwd=xxxxxxx"

Set objConnEnd = Server.CreateObject("ADODB.Connection")
objConnEnd.Open strConnect

strDelete = "DELETE formdata WHERE formMyCpsID = " &
Session.SessionID objConnEnd.Execute

strDelete objConnEnd.Close
Set objConnEnd = Nothing

End Sub

...can I access the Session.SessionID at this stage or has it already
been killed?


I don't know, but you could test this by global.asa:

Sub Session_OnEnd
application("testing") = Session.SessionID & "-!-"
End Sub

===============
In an asp-page test this with:

if application("testing") = "" then
respons.write "No session ended yet. Please try later."
elseif application("testing") = "-!-" then
respons.write "Session.SessionID not available in Session_OnEnd"
else
respons.write "Yes, Session.SessionID is available in Session_OnEnd"
end if

================
not tested ;-}
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 19 '05 #2
You can't rely on this to fire anyway.

http://www.aspfaq.com/2078
http://www.aspfaq.com/2491

--
http://www.aspfaq.com/
(Reverse address to reply.)


"cab" <ca*****@hotmail.com> wrote in message
news:40********@duster.adelaide.on.net...
i have the following code in the "Sub Session_OnEnd" routine that does not
seem to run.....

Sub Session_OnEnd

strConnect = "Driver={SQL Server};Server=SERVER;Database=database; User
ID=xxxxxx;Pwd=xxxxxxx"

Set objConnEnd = Server.CreateObject("ADODB.Connection")
objConnEnd.Open strConnect

strDelete = "DELETE formdata WHERE formMyCpsID = " & Session.SessionID
objConnEnd.Execute

strDelete objConnEnd.Close
Set objConnEnd = Nothing

End Sub

...can I access the Session.SessionID at this stage or has it already been
killed?

cheers,
cab.

Jul 19 '05 #3
cab
it thought this might have been the case.
i was testing my code below replacing the Session.SessionID with an actual
value in the database.
sometimes the database entry was deleted, but more often it was not.
thanks.
"Aaron [SQL Server MVP]" <te*****@dnartreb.noraa> wrote in message
news:u#**************@TK2MSFTNGP12.phx.gbl...
You can't rely on this to fire anyway.

http://www.aspfaq.com/2078
http://www.aspfaq.com/2491

--
http://www.aspfaq.com/
(Reverse address to reply.)


"cab" <ca*****@hotmail.com> wrote in message
news:40********@duster.adelaide.on.net...
i have the following code in the "Sub Session_OnEnd" routine that does not seem to run.....

Sub Session_OnEnd

strConnect = "Driver={SQL Server};Server=SERVER;Database=database; User
ID=xxxxxx;Pwd=xxxxxxx"

Set objConnEnd = Server.CreateObject("ADODB.Connection")
objConnEnd.Open strConnect

strDelete = "DELETE formdata WHERE formMyCpsID = " & Session.SessionID
objConnEnd.Execute

strDelete objConnEnd.Close
Set objConnEnd = Nothing

End Sub

...can I access the Session.SessionID at this stage or has it already been killed?

cheers,
cab.


Jul 19 '05 #4

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

Similar topics

3
by: Tom Bates | last post by:
I can successfully delete files using fso.DeleteFile when in an ASP script. But in Session_OnEnd, where I'd *really* like to clean up files, it appears that DeleteFile doesn't work. I've tried...
24
by: Nancy Drew | last post by:
hi all i'm trying to keep users from being able to login to a site twice at the same time. everytime a user does a login, i stick their userID into an application scoped array. if they try to...
14
by: Agoston Bejo | last post by:
Hi! Why doesn't the following code work? Sub Session_OnEnd Dim Conn Set Conn = Server.CreateObject("ADODB.Connection") Conn.ConnectionString = Application("Connection_String") Conn.Open ...
4
by: Propin | last post by:
Have a problem with below code in global.asa. Same problem as described in this news group before, IWAM_machinename did not solve my problem. Have created the following test code (file is never...
4
by: anand | last post by:
In my website i want to trace the event when user log off from the site by closing the explorer so i am unable to run any server side program at that time and my session_onend event also not...
6
by: Martin | last post by:
Hi, Since I went ASP.NET with my global.asa (making it a global.asax) the application events are called just fine as well as the Session_OnStart event but the Session_OnEnd event is not. What is...
1
by: Andy Kasotia | last post by:
My Session_OnStart works but Session_OnEnd does not work. Here's the code...can anyone tell me what's wrong with my code or if anything else on the server that needs to be changed. The...
11
by: David Thielen | last post by:
Hi; Is there some kind of session ID variable that I can get in the code behind and that is available in Session_OnEnd() to know what session ended? -- thanks - dave...
4
by: Chris Ashley | last post by:
There seem to be isolated occurences of Session_OnEnd not firing in my app. This is problematic because some clean up of resources happens here. I know the Session events were unreliable in classic...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...
0
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,...

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.