Results 1 to 2 of 2

Thread: delete

  1. #1
    Ranjith Guest

    Default delete

    hi,<BR>I want to delete a record from the table when a user closes his browser,I have written the script for this on the Session_OnEnd,but it&#039s not working,any help would be appreciated.<BR>My code goes like this:<BR><BR>SUB Session_OnEnd<BR>if Request.Cookies("name") &#060;&#062; "" then<BR>set connect = server.CreateObject ("ADODB.connection")<BR>connect.Open "DSN=xxx;UID=xx;PWD=xxxx;"<BR>set rs = server.CreateObject ("ADODB.recordset")<BR>str1 = "select user_id from eco_register where name = &#039" & trim(Request.Cookies("name"))<BR>rs.Open str, connect<BR>str = "delete from login where user_id = " & trim(rs("user_id"))<BR>connect.execute (str)<BR>rs.Close<BR>set rs = nothing<BR>connect.Close<BR>set connect = nothing<BR>end if<BR>END SUB<BR><BR>Thanks<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: delete

    the Session_OnEnd event is not reliable.<BR><BR>do not place into it any code which is important.<BR><BR>i believe there&#039s an MS KB article on this subject.<BR><BR>kurt

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts