I have a function that hashs the value that a user entered in a text
box and stored that hash value as a password. All is well unless a
user enters a password that when hased has a ; in it.
If a user entered 33333333 as the password my hash function returns a
value that includes a ; and then the DoCmd.RunSQl fails.
Is there a good way of fixing this? Since it is a hash of the password
I was thinking of maybe just running a function that replaces the ;
with another character before saving the value into the database.
my question is what would be the best way to do this? Also are there
any characters that I need to worry about?
txtUSERPWD_NEW_ HASH = HashString(txtU SERPWD_NEW)
DoCmd.SetWarnin gs False
DoCmd.RunSQL "UPDATE T_USER SET T_USER.USERPWD= '" & txtUSERPWD_NEW_ HASH
& "' WHERE T_USER.USERID=' " & txtUSERID & "' ;"
DoCmd.SetWarnin gs True
box and stored that hash value as a password. All is well unless a
user enters a password that when hased has a ; in it.
If a user entered 33333333 as the password my hash function returns a
value that includes a ; and then the DoCmd.RunSQl fails.
Is there a good way of fixing this? Since it is a hash of the password
I was thinking of maybe just running a function that replaces the ;
with another character before saving the value into the database.
my question is what would be the best way to do this? Also are there
any characters that I need to worry about?
txtUSERPWD_NEW_ HASH = HashString(txtU SERPWD_NEW)
DoCmd.SetWarnin gs False
DoCmd.RunSQL "UPDATE T_USER SET T_USER.USERPWD= '" & txtUSERPWD_NEW_ HASH
& "' WHERE T_USER.USERID=' " & txtUSERID & "' ;"
DoCmd.SetWarnin gs True
Comment