Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Auto deletion of record (expiration date) in access db and ASP 1

Status
Not open for further replies.

runsh

Technical User
Dec 19, 2004
16
US
I am trying to setup following code to delete records from data base after 30 days:
DELETE * from table1 WHERE DateDiff("d", table1.Date, Date()) >30;
questions:
1. will this code do the job
2. If so where this should be placed. should it be place where record is inserted. please give an example.

Thanks
 
you can put it in a vbs and run it on a schedule with task scheduler, or you can make a virtual scheduler and put it inside of global (not highly recommended)

[thumbsup2]DreX
aKa - Robert
if all else fails, light it on fire and do the happy dance!
 
Thanks drexor for reply
I don't know much about programing or writing script. do you have a source you can direct me to showing how to do what you have recommended.
 
How do i trigger ASP script periodically on server?
thread333-870967

[thumbsup2]DreX
aKa - Robert
if all else fails, light it on fire and do the happy dance!
 
Hi

Sorry to revisit this.....what database are you using? If it is SQL server make your SQL in to a stored procedure and run it as an SQL job and schedule a time and day/days for it to run.....this way the database does all the work and you can set it to a time when load is at it's lowest.

You can do this with task scheduler but I personally prefer to to do this type of thing platform permitting in the database.

Just my halr penny's worth

Thanks



Glen
Conception | Execution
 
Thanks glen for your input
database is Access database (ASP). I am trying to get as much info. as I can to set this up.
I am new to all these, trying to learn it.
 
DELETE * from table1 WHERE DateDiff("d", table1.Date, Date()) >30;

SYNTAX: should be delete from
no *
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top