**********************************************************
** How to build a Password control for you application?
**********************************************************
** by Subramanian.G (ramani)
** FoxAcc Software
** ramani_g@yahoo.com
**********************************************************
A password table maintained using VFP in the normal way will show the passwords out to any one opening the Table. In order to hide this password field, we have to do some sort of encrption of the password. But without encryption, decryption software, we can achieve this functionality. While what I suggest is a simple method, you can develop your idea on this.
In the password form, i.e. login form, obviously you will have the text or combo for the user name and then a textbox for the password. Set the txtPassword text box property,
[color /blue]
txtPassword.PasswordChar = "*"
[color /]
This will hide the characters keyed in by the user and so, no one near can read what is keyed in.
The next thing to do is...
1. Do not bind this txtPassWord box to the underlying table.
2. Replace the Tables password field with the encrpted password. HERE IS THE TRICK I SUGGEST FOR THIS.
[color /blue]
LOCAL cPassValue
cPassValue=SYS(2007,ALLTRIM(ThisForm.txtPassWord.Value))
REPLACE myPassWordField WITH cPassValue
[color /]
3. Whenever the password is accepted, compare for accepting it, by converting the same way.
[color /blue]
myInPass=SYS(2007,ALLTRIM(ThisForm.txtLogInPass.Value))
IF myPassFile.myPasswordField = myInPass
** LET THE USER IN
ELSE
** SHOW THE OUT-DOOR
ENDIF
[color /]
4. If you need still additional security, add the LogIn pass and at the creation time.. a standard additional text, for example..
[color /blue]
cPassValue = ;
SYS(2007,"SECRET"+ ALLTRIM(ThisForm.txtPassWord.Value))
[color /]
What we achieve is that, no one knows including you to decode this password field. Any one reading the Password Table cannot decode the checksum value.
- Ramani
**********************************************************
** EOF **
** Ramani (Subramanian.G), FoxAcc, ramani_g@yahoo.com
**********************************************************
Evaluate this to make others know how useful is this
