SunQuest
           ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
AT&T devCentral & BlackBerry(r) Webcast Series: BlackBerry and GPS -Build Location Awareness into your BlackBerry Applications, July 10th-1:00PM EST. Register Today!
  #1  
Old August 25th, 2003, 08:12 PM
shalee shalee is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 22 shalee User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
date

...my system works like this...when the user fill up the registration form..the system will capture the time ...if the person who registered didnt appear in 2 weeks...his/her data in the registration table will be deleted...by the system on its own...how to do this...using sql + asp...plzzz help

Reply With Quote
  #2  
Old August 26th, 2003, 07:23 AM
karsh44's Avatar
karsh44 karsh44 is offline
Just another guy
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Jun 2003
Location: Wisconsin
Posts: 2,915 karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 6 Days 13 h 6 m 22 sec
Reputation Power: 76
Which part are you asking about? The registration form, or the database update that removes members who have been inactive for 2 weeks? (BTW, you might want to make that more like a month. People could go on vacation or other reasons, and be offline for a couple weeks. They wouldn't want their info deleted every time they go on vacation)

And PLEASE, use proper capitalization and punctuation in your posts. It makes them much easier to read.

Reply With Quote
  #3  
Old August 26th, 2003, 08:21 AM
Vlince Vlince is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: Canada, Quebec, Montreal
Posts: 410 Vlince User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
-->People could go on vacation or other reasons, and be offline for a couple weeks<--

My god karsh44 how many times a year do you go for 2 weeks vacations or other can I work where you work

j/k

hehe...

Reply With Quote
  #4  
Old August 26th, 2003, 08:28 AM
karsh44's Avatar
karsh44 karsh44 is offline
Just another guy
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Jun 2003
Location: Wisconsin
Posts: 2,915 karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 6 Days 13 h 6 m 22 sec
Reputation Power: 76
Its the annual vacation

And if my memberships were cleared after I got back, it would be really annoying, even if it was only once a year.

As I think about it more, there are sites I have memberships at which I don't visit every 2 weeks even when I'm home, so unless shalee can be certain that people will visit that often, the time span needs to be longer.

Reply With Quote
  #5  
Old August 26th, 2003, 11:05 AM
zimm zimm is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 30 zimm User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Your problem is one of state (when isn't that a "problem" in ASP).

If I were tasked to do what you are doing, I would write a DLL and run it as a scheduled task.

The whole ASP model is event driven; that is to say that you write code to respond to when a user does SOME thing. In this case, you are trying to cause an action to occur (delete records) when a user has done NO thing rather than SOME thing. There are ways of triggering your stored procedure within the ASP model when NO thing occurs, but it's complicated, and it's dependent upon other things.

Vlince or untrnang may have a better suggestion than I, but like I said, if it were up to me, I'd write a DLL. From my perspective, it's the easiest thing to do.

In task scheduler, set the DLL to run once a day (Can't imagine you'd want it to run any more frequently than that).

Inside the DLL, all you have to do is:
  • create a connection object
  • create a command object
  • have the command object execute a stored procedure that deletes records once the date stamp is X days old.

Maybe 30 lines of code (including the error trapping should the connection fail, etc).

Last edited by zimm : August 26th, 2003 at 11:12 AM.

Reply With Quote
  #6  
Old August 26th, 2003, 11:10 AM
karsh44's Avatar
karsh44 karsh44 is offline
Just another guy
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Jun 2003
Location: Wisconsin
Posts: 2,915 karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 6 Days 13 h 6 m 22 sec
Reputation Power: 76
The dll is a good idea. If you don't know how to do that, though, a quick and dirty method would be to have the delete command run every time someone logs in, so every log in event would cause the query to look for people who have been inactive for a month (or 2 weeks, if you insist).
This would increase the load on the server though, probably to unmanageable levels, unless you don't have many users.

Overall, I would definitely recommend the dll route if you can, this was just an easier (to write) alternative.

Reply With Quote
  #7  
Old August 26th, 2003, 11:34 AM
zimm zimm is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 30 zimm User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Quote:
Originally posted by karsh44
The dll is a good idea. If you don't know how to do that, though, a quick and dirty method would be to have the delete command run every time someone logs in, so every log in event would cause the query to look for people who have been inactive for a month (or 2 weeks, if you insist).
This would increase the load on the server though, probably to unmanageable levels, unless you don't have many users.

Overall, I would definitely recommend the dll route if you can, this was just an easier (to write) alternative.


Just thought of another solution, and is probably easier than writing a DLL.

Create a new application variable that holds the current date.
Create a new application variable that holds the current date + 1.

Create a new session variable that holds the date that the user logged on.

If session_date = application_date + 1 then
&nbsp;&nbsp;&nbsp;application_date = application_date + 1
&nbsp;&nbsp;&nbsp;execute the delete stored procedure
End if

The only time that the code inside this if block should execute is the first time somebody logs on in a given 24-hour period. Every subsequent logon should have a session-date that is equal to the application_date.

This is probably easier than writing a DLL.

Last edited by zimm : August 26th, 2003 at 02:30 PM.

Reply With Quote
  #8  
Old August 26th, 2003, 03:09 PM
aspman aspman is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: Ashburn,VA
Posts: 105 aspman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 h 22 m 40 sec
Reputation Power: 5
one other way is to write a procedure in db and schedule it as a job. That's super easy.

Code:
Create procedure procedure name ()
is

begin
delete statement;

end;

and you can ask your dba to schedule the job for you that can run once a day.
__________________
If you ask a question you are a fool for a second. But if you dont ask, you are a fool for a life time.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > date


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway