Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 21st, 2004, 02:35 PM
Authorized User
 
Join Date: Mar 2004
Posts: 84
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to gmoney060 Send a message via MSN to gmoney060
Default Automatically deleting from databases

Hello, I am tracking peoples IP address so they can only vote 1 one. But i want them to be able to every week. So i want to be able to delete all the IP address from the datbase every week. i was wondering if i can set it up so it does it automatically, or would i have to manually do it every week.

 
Old July 21st, 2004, 02:46 PM
Friend of Wrox
 
Join Date: Aug 2003
Posts: 205
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You can do it automatically through a number of ways.
1. If your DB is SQL Server you could set it up in a SQL job (I am sure other server DBs such as Oracle have similar functionality, but I am not aware of it).
2. You could store a date with the IPAddress and in your code check if it is past a week. If so, change the date and allow the query to continue, otherwise abort the process.
3. Assuming you are on a windows platform (a fair assumption for ASP) you could use a windows scheduled task to execute a script and delete from this table. Similarly, you could set up a service to do the same thing.

I am sure there are many other ways, but these are the first three that come to mind.

Yehuda
 
Old July 21st, 2004, 11:24 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

What database do you use?

_________________________
- Vijay G
Strive for Perfection
 
Old July 21st, 2004, 11:43 PM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 463
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to madhukp
Default

How I did it in a similar situation is like this.

In my system, admin will make a poll live. So when a new opinion poll goes live, I deleted all IP addresses from database. Check whether this is possible in your case.

The scheduled deletions has got a drawback in my context. They will work every week at the same time. But the new poll may not be ready by that time. That is why I had to do it in this way.

 
Old July 25th, 2004, 12:12 AM
Authorized User
 
Join Date: Mar 2004
Posts: 84
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to gmoney060 Send a message via MSN to gmoney060
Default

MS Access

 
Old July 25th, 2004, 12:02 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

You can write a vbs file that deletes all the IPs and use windows schedule task to run it at a time just before the next poll goes live.

Or

As madhu suggested you can go ahead and delete the IPs before the next poll goes live from within your web app, as that would be easier to control deletion from within your application, instead of doing it from an external application which you got to reschedule in case there is a change in the time when the next poll goes live.

Hope that helps.
Cheers!

_________________________
- Vijay G
Strive for Perfection





Similar Threads
Thread Thread Starter Forum Replies Last Post
can not login automatically lukemai ASP.NET 1.0 and 1.1 Professional 2 December 19th, 2007 02:42 PM
Transform Automatically DJAJ XSLT 0 March 10th, 2006 09:38 PM
Automatically change value abhisheksud Classic ASP Databases 0 December 13th, 2005 02:33 AM
Deleting text strings automatically from Database palvin SQL Server 2000 15 October 3rd, 2005 12:52 PM
Automatically Finding and Deleting Blank rows Romulus Excel VBA 3 October 18th, 2003 09:04 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.