LOGIN email passwords

D

Downie

I've got the Login verification process working
(UserID will be email address

Scenario:
A user forgets their password?
I'd like them to be able to the user and email with userid and password

I thinking the user will enter in their email address[userid]
Click a get password button.

BELOW Is what I have coded behind the get password button.
(Basically stores the email on the form and runs a check in the users
data table
Finds a match
Emails both the user id and password back to their inbox.)

The WHERE CLAUSE is giving me

Run-time error '-2147217900 (80040e14)'
Syntax error (missing operator) in query expression '((users.Login) =
(e-mail address removed))'.

Private Sub Command32_Click()

Dim SQLString 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 ((users.Login) = " & Login.Value &
");"

cmd.CommandText = SQLString

rst.CursorLocation = adUseClient
rst.Open cmd, , adOpenKeyset, adLockOptimistic
 
D

Downie

Now seeing
Run-time '-214721799 (80040e14)': Extra ) in query expression '[Login]
= "")'.
 
D

Downie

Actually!

Any suggestions on how to get the the rst! results back to the users
inbox???

Private Sub Command32_Click()

Dim SQLString 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

'''' MsgBox (rst.GetString)

If rst.RecordCount > 0 Then
DoCmd.SendObject


End If

End Sub
 

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


Top