|
Hi. I'm creating a 'Forgotten Password' application. When I test it I get the following error:
Microsoft OLE DB Provider for ODBC Drivers error '80040e10'
[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.
/secure_login/forgotten_password.asp, line 21
The code I am using is:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="../Connections/dsnUsers.asp" -->
<% IF Trim(Request.Form("submit")) <> "" Then %>
<%
Dim rsPassword__MMVariable
rsPassword__MMVariable = "x"
If (Request.Form("username") <> "") Then
rsPassword__MMVariable = Request.Form("username")
End If
%>
<%
Dim rsPassword
Dim rsPassword_numRows
Set rsPassword = Server.CreateObject("ADODB.Recordset")
rsPassword.ActiveConnection = MM_dsnUsers_STRING
rsPassword.Source = "SELECT email, first_name, password FROM tblUsers WHERE username = " + Replace(rsPassword__MMVariable, "'", "''") + ""
rsPassword.CursorType = 0
rsPassword.CursorLocation = 2
rsPassword.LockType = 1
rsPassword.Open()
rsPassword_numRows = 0
%>
<%
Set objCDO = Server.CreateObject("CDONTS.NewMail")
objCDO.From = "email address"
objCDO.To = rsPassword.Fields.Item("email").Value
objCDO.Subject = "Here is the password you requested"
objCDO.Body = "Your password is: " & rsPassword.Fields.Item("password").Value
objCDO.Send
Set objCDO = Nothing
%>
<% Response.Redirect("forgotten_password.asp") %>
<% END IF %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
<link href="stylesheets/main.css" rel="stylesheet" type="text/css">
</head>
<body>
<form name="form1" method="post" action="forgotten_password.asp">
<table width="44%" border="0" align="center" cellspacing="4">
<tr>
<td width="24%" class="body-text">Username</td>
<td width="76%"><input type="text" name="textfield"></td>
</tr>
<tr>
<td> </td>
<td><input type="submit" name="Submit" value="Submit"></td>
</tr>
</table>
</form>
</body>
</html>
<% IF Trim(Request.Form("submit")) <> "" THEN %>
<%
rsPassword.Close()
Set rsPassword = Nothing
%>
<% END IF %>
|