現在、特にログイン用のユーザー名とパスワードを保存するMySQLデータベースがあります。ユーザーのパスワードと名前を要求し、それをMySQLのユーザー名とパスワードと比較し、一致すると別のMS Accessフォームを開く、作成したログイン画面を備えたMS Access 2010フロントエンドがあります。パスワードを MySQL データベースのハッシュ sha1 に保存したいのですが、ユーザーが MS Access フォームに入力したパスワードを取得し、それをハッシュ sha1 に変換して vbscript を作成する方法がわかりません。その特定のユーザーの MySQL データベースに既にあるものと比較してください。ハッシュを使用していなかったときに使用した vbscript を含めました。どんな援助でも大歓迎です。
'compares username and password to a query and will either open another form OR display an incorrect password message.
Dim dbs As Database
Dim rstUserPwd As Recordset
Dim bFoundMatch As Boolean
Set dbs = CurrentDb
'query that has all the usernames and password
Set rstUserPwd = dbs.OpenRecordset("qryUserPwd")
bFoundMatch = False
If rstUserPwd.RecordCount > 0 Then
rstUserPwd.MoveFirst
'name of the access form is called 'Login'
Do While rstUserPwd.EOF = False
If rstUserPwd![UserName] = Form_Login.txtusername.Value And rstUserPwd![Password] = Form_Login.txtpassword.Value Then
bFoundMatch = True
Exit Do
End If
rstUserPwd.MoveNext
Loop
End If
'open admin form
If bFoundMatch = True
DoCmd.Close acForm, Me.Name
DoCmd.OpenForm "admin"
Else
MsgBox "Incorrect User Name or Password"
End If