ASP classic logic issue
I have recently taken over a website written in ASP Classic. It uses a MS access database for the back end.
The website allows people to sign in and pay a membership fee in order开发者_StackOverflow to keep there account active.
My Problem is when someones account expires I have no way to change the status of the account from active to inactive. All of the code uses that as a reference rather then the dates. Any suggestions on how I could automatically go through and deactivate accounts as they expire?
Thanks
You didn't provide details about how you store that information, but perhaps you are able to update account status with an UPDATE query similar to this:
UPDATE tblMembership
Set Active = False
WHERE expiration_date < Date();
Since you can't connect to the the database directly. You can run the UPDATE statement from an ASP page. And open that page when you want to update membership status.
Another possibility is to change the criteria for the query you use to display the membership list.
WHERE
Active = True
And expiration_date >= Date();
That way you would filter out expired members whose [Active] status hasn't been updated yet.
There's a number of ways to do this. One thing you can do is create a simple update function that goes through the database, checks dates and "deactivates" any expired accounts. I would put this function into the login proceedure so that it checks the user account and deactivates it if expired. So during login, when the user provides credentials and you take those credentials and compare against stored database values, at the same time you could check expiration dates and deactivate the account if expired. Hope that makes sense.
If you have access to the server, maybe using the task scheduler to run a vb script to update the database as suggested by Damon.
精彩评论