cab wrote on 08 jun 2004 in microsoft.publi c.inetserver.as p.general:
i have the following code in the "Sub Session_OnEnd" routine that does
not seem to run.....
Sub Session_OnEnd
strConnect = "Driver={SQ L Server};Server= SERVER;Database =database;
User
ID=xxxxxx;Pwd=x xxxxxx"
Set objConnEnd = Server.CreateOb ject("ADODB.Con nection")
objConnEnd.Open strConnect
strDelete = "DELETE formdata WHERE formMyCpsID = " &
Session.Session ID objConnEnd.Exec ute
strDelete objConnEnd.Clos e
Set objConnEnd = Nothing
End Sub
...can I access the Session.Session ID 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("te sting") = Session.Session ID & "-!-"
End Sub
===============
In an asp-page test this with:
if application("te sting") = "" then
respons.write "No session ended yet. Please try later."
elseif application("te sting") = "-!-" then
respons.write "Session.Sessio nID not available in Session_OnEnd"
else
respons.write "Yes, Session.Session ID is available in Session_OnEnd"
end if
=============== =
not tested ;-}
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)