Last post Mar 18, 2014 06:10 PM by hans_v
Feb 28, 2014 05:56 AM|uid571490|LINK
how can we delete a record in it's expiredate automatically?
thanks a lot
Feb 28, 2014 06:03 AM|PatriceSc|LINK
If you have full control on your db server, it could be for example a SQL job that would delete those rows. You could also just ignore them when selecting data rather than really deleting them.
Feb 28, 2014 06:03 AM|Ashim Chatterjee|LINK
You can directly write sql query for that in a sql job which will execute everyday once.
Delete from tblname where ExpiryDate = getdate()
Feb 28, 2014 06:08 AM|uid571490|LINK
excuse me! but I as I know we can't use jobs in access database!
am I wrong?
Feb 28, 2014 06:13 AM|uid571490|LINK
You could also just ignore them when selecting data rather than really deleting them.
yes, but I want to delete unneccessary data to avoid my table be heavy after long time.
Feb 28, 2014 06:13 AM|Ashim Chatterjee|LINK
ops ... sorry .. missed that :D .. well
here is a way to do schedule a task in access ..
and to schedule a .bat file check this:
Feb 28, 2014 06:48 AM|uid571490|LINK
and, based on that two links, I think theres nothing to do with my asp.net website and I need to have access to windows server of my host?
am I right?
Feb 28, 2014 07:03 AM|PatriceSc|LINK
Depending if the expiry date must be taken into account at the minute or if it can be a bit delayed, the simplest option could be to run that sometimes (for example when a user logs), or every time you are about to display those rows (make sure you have
an index on this date) to a user and/or ignore those rows. This way you have nothing to schedule. You just manage this as needed when the users asks for those rows.
Else you have some hosting services (such as
https://www.setcronjob.com/ ) allowing to call a page on another web site for you. You could then have a cleanup page in your main app that would be called once a day or whatever and that would perform this clean up job.
Mar 18, 2014 02:45 PM|Aylwin|LINK
http://www.easycron.com is another free cron job provider which is worth a try.
Mar 18, 2014 06:10 PM|hans_v|LINK
I think theres nothing to do with my asp.net website and I need to have access to windows server of my host?
You can try this trick: