admin
06-04-2003, 02:44 PM
For an Access database:
set conn = server.createobject("adodb.connection")
conn.open <database connection>
dtmDate = Date()-1
strSQL = "Delete * from Table1 where fldDate < #" & dtmDate & "#"
conn.execute(strSQL)
This will delete all records created before midnight of 2 days ago basically. You can alter that with the dtmDate = Date()-<insert days to delete>
This code will only be executed if someone tries hitting the ASP page though.
By Fid
set conn = server.createobject("adodb.connection")
conn.open <database connection>
dtmDate = Date()-1
strSQL = "Delete * from Table1 where fldDate < #" & dtmDate & "#"
conn.execute(strSQL)
This will delete all records created before midnight of 2 days ago basically. You can alter that with the dtmDate = Date()-<insert days to delete>
This code will only be executed if someone tries hitting the ASP page though.
By Fid