ASP/.NET Web Hosting
* 3 Months FREE *
CLICK HERE!
 CoverYourASP --> Removing unconfirmed members --> Part 5

Free membership

Join in the fun! Sign in
Member Services

Site navigation
Download the entire site!
Search my articles
Free Magazines
Browse the directory

Send me feedback
Buy my boxer shorts

Recommend this page
Printer-friendly page

Resources I recommend
Link to my site
Advertising slashed!
About your privacy
Legal stuff
Site statistics
70 active users
2571 visitors today
4646 pages today
how is this done?
Tools I use

CoverYourASP
Copyright © 1999-2008 James Shaw.
All rights reserved.

ASP.NET Blog
RSS submissions
E-commerce

Now open source with SourceForge!

Deleting unconfirmed members

Deleting the members still unconfirmed after 10 days was done by looping through the records, and making up a SQL statement that included all of the member ID's.

That way I only had one SQL statement to execute, outside of the loop.

var sDelete = '';

while ( !oRecordSet.EOF )
{
   var nID = oRecordSet ( 0 ) - 0;
   var dDate = new Date ( oRecordSet ( 3 ) );

   // either send an email, or delete them..
   if ( dDate.getDate ( ) == nDate )
   {
      ...
   }
   else
   {
      if ( sDelete.length )
         sDelete += ' OR ';

      sDelete += 'MemberID=' + nID;
   }

   oRecordSet.moveNext ( );
}

if ( sDelete.length )
   oConnection.Execute ( 'DELETE FROM Members WHERE ' + sDelete );

And that's it. The first new visitor to arrive on my site after midnight (server time) will cause the RemindMembers( ) function to be called, and unconfirmed members dealt with as appropriate.

And one less job for me to do manually, which I personally think is very cool!

There's too much code to list, but you can download everything by clicking on the icon.

Featured sponsor
My favorite resources

Tiki Statues - Tiki Masks - Tiki Totems



I share my content

Supporting ASPRSS

Do you need a quick and easy way to link to my articles? All the information you need is published with ASPRSS...

CoverYourASP Mugs, T-shirts, caps - even Boxer shorts...
I don't make a penny from these, but they're a lot of fun! Don't you need a new mouse mat?