Login and Update Query (Full Version)

All Forums >> [Web Development] >> ASP and Database



Message


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 -> 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.




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.





Mojo -> 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





Spooky -> 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!





Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.09375