User requests password in email.

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
 
B

Brendan Reynolds

What's preventing anyone from simply opening the table and reading the
passwords?
 
D

Douglas J Steele

Brendan's question was "What are you going to do to ensure that they can't
just open the database and read the password?"
 
B

Brendan Reynolds

You asked whether you were 'going down the wrong path'. I suspect that you
probably are, but without a meaningful answer to my question, there's not
much I can do to help you on that score. As a general rule, I would say that
storing passwords in plain text in a JET database is something to be
approached with extreme caution.

For info on various methods of sending e-mail from Access, see the links at
the following URL ...
http://www.mvps.org/access/general/gen0009.htm
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

LOGIN email passwords 4
Login Code to Open BRANCHES FORM 4
Copy and create recordset 2
Public Sub to run Private Function 1
Work Around for Like '*active*' 5
Having Like 16
ADODB 2
ADODB .Execute error 2

Top