navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

Microsoft MVP

 

Login and Update Query

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP and Database >> Login and Update Query
Page: [1]
 
Guest


 
Login and Update Query - 2/28/2001 20:49:00   
I need to deactivate a users account when they have logged in for 5 times. I have a Update Query that does this based on when LoginCount > 5 then Update ActiveAccount to "False".
This does the job but only if I go in and run the Update Query manually.

Is there anyway to automate the processs so the Query is run whenever a Login event has occurred.
OR does someone have a better (easier) way to do this?

Thanks

Spooky

 

Posts: 26597
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: Login and Update Query - 2/28/2001 14:53:00   
Youd need to have a check that doesnt only check for user name and password, but also that logincount is less than 6 as part of the SQL string.

(in reply to Guest)
Guest


 
RE: Login and Update Query - 3/1/2001 20:40:00   
Thanks Spooky...but this won't update the database itself will it, so whilst your suggestion would check each login we would still have to run the query to actually deactivate the account.

Also can you clarify before I go and mess it up:
You would check the login count in the /includes/a_login.asp page, in the section Check database for matches. (Or am I showing my lack of knowledge here)
Thanks for your help.


(in reply to Guest)
Mojo

 

Posts: 2429
From: Chicago
Status: offline

 
RE: Login and Update Query - 3/1/2001 20:50:00   
Maccy,
I have been lurking on this post because it kind of interests me...

A cheesy way I did it was to query the login count AFTER they had already logged in, but BEFORE they were redirected to my main page. Basically, I made an ASP file with this DB query that they just pass through. You do not even notice it unless you have exceeded your login count.

I hope that made sense. Spooky will surely have a better method, but this works for me... for now.

Joe


(in reply to Guest)
Spooky

 

Posts: 26597
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: Login and Update Query - 3/1/2001 13:08:00   
Oh, your talking about the spooky login!

In the Set SQL String, you could set the top SQL string to :

AND Password='"&T2&"' AND LoginCount < 6"

In the database match, you could try :

Now:
objRs.fields.item(11).Value = objRs.fields.item(11).Value + "1"

Change:
objRs.fields.item(11).Value = objRs.fields.item(11).Value + "1"
LoginCount = objRs.fields.item(11).Value
If LoginCount = 5 then objRs.fields.item(9).value = 0

Its not a very clean way of doing it, I prefer just the SQL.

They would get "details not found" and couldnt log in anyway. Im not sure what deactivating would do any better?

------------------
Spooky
"I am Spooky of Borg. Prepare to be assimilated, babycakes!"
Subscribe to OutFront News
Database / DRW Q & A
The Spooky Login!


(in reply to Guest)
Page:   [1]

All Forums >> Web Development >> ASP and Database >> Login and Update Query
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts