Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

ASP.NET Forum


You are currently viewing our ASP.NET Forum as a guest. Please register to participate.
Login



Reply
Creating a 'Forgotten Password' application
Old 06-28-2004, 02:02 AM Creating a 'Forgotten Password' application
Novice Talker

Posts: 9
Trades: 0
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>&nbsp;</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 %>
Funky Monk is offline
Reply With Quote
View Public Profile Visit Funky Monk's homepage!
 
 
Register now for full access!
Reply     « Reply to Creating a 'Forgotten Password' application
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.20031 seconds with 12 queries