Forums

ASP

This topic is locked

delete from database using global.asa

Posted 19 Jul 2007 06:57:16
1
has voted
19 Jul 2007 06:57:16 Charles Knight posted:
Hi all

Am trying to use the global.asa to delete all entries in a database created by a user if they exit the site without doing anything else.

When they create the db entry I add the unique session id to the table so I want to delete the records based on that number.

Here is my global.asa so far, can anyone tell me where I'm going wrong:


<SCRIPT LANGUAGE="VBScript" RUNAT="Server">

Sub Application_OnStart

set conn=Server.CreateObject("ADODB.Connection"
conn.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\website\db\mydb.mdb"
set rs=Server.CreateObject("ADODB.recordset"
rs.Open "Select * from my_table", conn

End Sub

Sub Application_OnEnd
End Sub


sub Session_OnEnd
strSQl = "DELETE FROM my_table WHERE session_id = 'session.session_id'"
end sub

</SCRIPT>

DW8 | ASP | ACCESS

Edited by - caknight on 19 Jul 2007 07:01:46

Edited by - caknight on 19 Jul 2007 13:01:00

Reply to this topic