automatic delettions from table

Results 1 to 2 of 2

Thread: automatic delettions from table

  1. #1
    Join Date
    Dec 1969

    Default automatic delettions from table

    Can there be an asp page that runs every day to delete records that are 2 weeks old. I know the page can be done, but make it run by itself at a certain hour of the day.

  2. #2
    Join Date
    Dec 1969

    Default RE: automatic delettions from table

    While it is not exactly what you are looking for, I run a delete SQL in the Session_OnStart of the global.asa. This of course assumes you aren&#039t using sessionless asp pages.<BR>For example<BR>set conn=server.creatobject("adodb.connection")<BR>con DSN,user,pword &#039whatever yours are<BR>sql="DELETE FROM your_table where Time_Field &#060; " & (date-14)<BR>conn.execute sql<BR><BR><BR>I am not sure of the (date-14) part but I am sure you get the idea. This take a second when each user hits the site but it might be often enough and OK for you.<BR><BR>Another option is to put essentialy the same code into a vb executable and run it on a scheduled basis using any one of the freely available task schedulers. (we use WinAT)<BR><BR>Mike<BR>

Posting Permissions

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