Well, ignoring declarations of the variables and the procedures which I don't expect you'll need, the breakdown is as follows :
I hope that helps.
- Line #7 is the basic structure of the WHERE clause that is applied when searching through the table. We need to check that both the Initials and tyhe password match.
- Line #8 replaces %I in the string with the actual value from your form control.
- Line #9 replaces %P in the string with the actual value from your form control for Password after it's been through the mangler of Encrypt().
- Line #10 checks in the table for a record that matches what the user has entered. If there is no match then the return will be Null.
- Lines #11 through #13 only execute if a matching record was found. This is fundamentally your code anyway, so no further explanation required.
- Line #18 returns whatever was passed as a parameter as the return value of Encrypt(). In your case that's probably not a great idea, but worrying about the details of your encryption algorithm is not part of the answer.
I hope that helps.
Comment