D
Downie
My Access database needs a user id and password to get in
The user id will be their email address
I'm trying to cover the scenario when the user forget their password.
I figure they can enter in their user id (email address) and click a
get password button.
I think I'm close but open to better suggestion if I'm going down the
wrong path?
Private Sub Command32_Click()
Dim SQLString As String
Dim Password As String
Dim html As String
Dim cnn As New ADODB.Connection
Dim cmd As New ADODB.Command
Dim rst As New ADODB.Recordset
DoCmd.SetWarnings False
Set cnn = CurrentProject.Connection
Set cmd.ActiveConnection = cnn
SQLString = "SELECT users.Login, users.Password "
SQLString = SQLString & "From users "
SQLString = SQLString & "WHERE [Login] = """ & Me![Login] & """;"
cmd.CommandText = SQLString
rst.CursorLocation = adUseClient
rst.Open cmd, , adOpenKeyset, adLockOptimistic
If rst.RecordCount > 0 Then
DoCmd.OutputTo acOutputReport, Password, html
DoCmd.SendObject acSendReport, Password, [To] = """ &
Me![Login] & """
End If
End Sub
The user id will be their email address
I'm trying to cover the scenario when the user forget their password.
I figure they can enter in their user id (email address) and click a
get password button.
I think I'm close but open to better suggestion if I'm going down the
wrong path?
Private Sub Command32_Click()
Dim SQLString As String
Dim Password As String
Dim html As String
Dim cnn As New ADODB.Connection
Dim cmd As New ADODB.Command
Dim rst As New ADODB.Recordset
DoCmd.SetWarnings False
Set cnn = CurrentProject.Connection
Set cmd.ActiveConnection = cnn
SQLString = "SELECT users.Login, users.Password "
SQLString = SQLString & "From users "
SQLString = SQLString & "WHERE [Login] = """ & Me![Login] & """;"
cmd.CommandText = SQLString
rst.CursorLocation = adUseClient
rst.Open cmd, , adOpenKeyset, adLockOptimistic
If rst.RecordCount > 0 Then
DoCmd.OutputTo acOutputReport, Password, html
DoCmd.SendObject acSendReport, Password, [To] = """ &
Me![Login] & """
End If
End Sub