Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

help in log in form

Status
Not open for further replies.

zhed0708

IS-IT--Management
Jun 25, 2011
41
PH
how to close log in form if the user login in 3 attempts?

zhed
 
am what i mean sir is when the user log in 3 attempts with invalid password,the log in will be close.

zhed
 
You need a counter and decrement that from the number of attempts you allow - when it reaches zero say "bye" and use the code Mike suggested to close the form:

So add a text box to your login form - at production time make its visible property false, but for testing leave it as is.

Then in the forms init method:
Code:
Thisform.MaxAttempts.Value = 3

Then in the click event for the button (presumably) that triggers your validation:
Code:
thisform.MaxAttempts.Value = thisform.MaxAttempts.Value -1
if thisform.MaxAttempts.Value < 1
  Thisform.release
Else
  && do your validation here
endif


Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.
 
Just to add to Griff's excellent answer:

You should, of course, also give the user a polite message, telling them why you are not letting them log on. This should include some advice about what to do if they have forgotten their password (e.g. contact their administrator).

Mike



__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
That's fine, but you really should try and find a tutorial to move yourself along with VFP.

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.
 
I can only second Griff about getting more grip on VFP in general via some tutorials.

If you even don't know how to store a counter value at the form level,to check it incremented to 3 or decremented to 0, then you really don't know nothing about foxpro and as you tend to do quite some stuff you should take the time to get more ecffective and learn basics, in your own interest. This is nothing you do in the forum, this is more done autodidactic or interactive in a regional group of vfp developers having a regular meeting.

The only other assumtion I could make is, that you're very helpless in getting any idea about how to solve problems even outside foxpro, but I wouldn't want to go as far.

Bye, Olaf.
 
Zhed,

Although I agree with the previous two messages, I hope they won't disourage you in your work in Visual FoxPro. We all have to go through this learning process.

I think the point we are making is that you should use this forum to ask specific questions about the FoxPro language and database, and to get help for specific problems such as unexpected errors. But the forum is not a teaching tool, and is no substitute for proper training or self-study.

Please don't be put off by our responses, and do come back when you have some specific questions.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
We have seen you repeatedly ask us to HAND YOU A WORKING ANSWERS to your question instead of seeing you working on FINDING YOUR OWN ANSWER.

If you had tried something and it was not working in some specific manner, we would be glad, if you told us specifically what was not working, to assist you or to make suggestions for you to try.

But we are not here to just write your application for you - question-by-question.

Yes - we want to encourage you to continue working with Visual Foxpro, but, as has been said above and has been said in some of your other postings, TAKE ACTION ON YOUR OWN TO LEARN THE LANGUAGE FIRST.
After that come here for help with specific problems.

Good Luck,
JRB-Bldr
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top