Click to See Complete Forum and Search --> : Wrong number of arguments or invalid property assignment
Brachole
04-12-2008, 02:23 PM
I keep getting this error:
Wrong number of arguments or invalid property assignment: 'String'
My code on that line is:
<%if (rsFindPassword.EOF AND rsFindPassword.BOF AND String(Request.Form("Submit")) <> "undefined") THEN%>
I usually write in Javascript, but I need this in VBScript...tried converting but without success!
Any idea?
yamaharuss
04-12-2008, 09:44 PM
What is the string() function?
Also, why are you checking for EOF AND BOF?
try:
<%if (NOT rsFindPassword.EOF AND Request.Form("Submit") <> "") THEN%>
Brachole
04-13-2008, 10:34 AM
actually, this is my "Forgot Password" page. The page shows a form where you enter your email address. Once you click the Submit button, it searched the DB for this emauil address. If found, it sends the password via email. If not found, it dispplays a message "Sorry could not find email...".
If the email is sent, it redirect to a succesfull page! The page works if found a valid email, it sends the password. The problem is when a record could not be found!
My code works in Javascript, but can't really make the string work in VBScript. In Javascript, this is the string:
<%
if (rsFindPassword.EOF && rsFindPassword.BOF && String(Request.Form("Submit3")) != "undefined")
{
%>
yamaharuss
04-13-2008, 09:14 PM
Did you try my code?
Brachole
04-14-2008, 09:46 AM
i did try but no luck...
yamaharuss
04-14-2008, 09:55 AM
"no luck".. meaning you are getting the same error? You are unable to copy/paste the code? or getting the MS "no luck" error?
Brachole
04-14-2008, 10:04 AM
there's no error code....the message just won't display. In other words, If the email is found, it sends the email and redirects to a success page. If the email is not found, it display the message "sorry no email found..."
So with your code, if the email is found, it redirects to the success page. If it doesn't find it, nothing is displayedm just the form again.
You can try for yourself at http://zeninvestor.org/ForgotPassword.asp
If you want, I can email you my ASP page...
Thanks.
russell
04-15-2008, 01:55 PM
you'll need to post the code -- particularly what happens after that line becuase yamaharuss solved the 1st problem for u. now u have a different one...
yamaharuss
04-15-2008, 01:58 PM
You'll also need to tell us what's wrong. According to your last post, the code is doing what it's supposed to.... unless you're wanting it to do something different.
Brachole
04-19-2008, 12:16 PM
Sorry about this....here's my page!
<%
Dim rsFindPassword__MMColParam
rsFindPassword__MMColParam = "1"
If (Request.Form("Email") <> "") Then
rsFindPassword__MMColParam = Request.Form("Email")
End If
%>
<%
Dim rsFindPassword
Dim rsFindPassword_numRows
Set rsFindPassword = Server.CreateObject("ADODB.Recordset")
rsFindPassword.ActiveConnection = MM_Datasource_STRING
rsFindPassword.Source = "SELECT * FROM Members WHERE EmailAddress = '" + Replace(rsFindPassword__MMColParam, "'", "''") + "'"
rsFindPassword.CursorType = 0
rsFindPassword.CursorLocation = 2
rsFindPassword.LockType = 1
rsFindPassword.Open()
rsFindPassword_numRows = 0
%>
<%
If Not rsFindPassword.EOF Or Not rsFindPassword.BOF Then
Dim MyMail
Set MyMail = Server.CreateObject("CDONTS.NewMail")
HTML = HTML & "<p><font size =""2"" face=""Arial"">"
HTML = HTML & "Dear " & (rsFindPassword.Fields.Item("Name").Value) & ",<p>"
HTML = HTML & "We recently received a request to e-mail your password to you. Your Zen Investor Account password can be found below. <p>"
HTML = HTML & "Your Password is: <strong>" & (rsFindPassword.Fields.Item("Password").Value) & "</strong><p>"
HTML = HTML & "You can use your E-mail Address and this Password to sign in at <a href=http://www.zeninvestor.org/Login.asp>www.zeninvestor.org/Login.asp</a><p>"
HTML = HTML & "Thank you,<p>"
HTML = HTML & "Zen Investor<br>"
HTML = HTML & "<a href=http://www.zeninvestor.org/>www.zeninvestor.org</a><br>"
HTML = HTML & "<hr><font size =""1"" face=""Arial"">Please do not reply to this email as it will not be answered. This is an automated response from Zen Investor."
MyMail.From = "AccountSupport@zeninvestor.org"
MyMail.To = (rsFindPassword.Fields.Item("EmailAddress").Value)
MyMail.Cc = ""
MyMail.Subject = "Your Zen Investor Account Information"
MyMail.BodyFormat = 0
MyMail.MailFormat = 0
MyMail.Importance = 2
MyMail.Body = HTML
MyMail.Send()
Set MyMail = Nothing
Response.Redirect("ForgotPassword_Succ.asp")
END IF
%>
<table width="800" border="0" align="center" cellpadding="0" cellspacing="0">
<tr bgcolor="#FFFFFF">
<td width="873" height="19"><table width="690" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="348" class="AlignementTopLeft"><p class="ArialBlackBold_16"> </p>
<h1>
<p class="ArialBlackBold_16">Forgot Password</p>
</h1>
<p><font size="2" face="Arial, Helvetica, sans-serif">To have your Password
sent to you, simply enter your e-mail address below. Zen Investor
will send you an e-mail with your account information.</font>
</p>
<%if (NOT rsFindPassword.EOF) AND (NOT rsFindPassword.BOF) AND (Request.Form("Submit") <> "") THEN%>
<table width="100%" border="0">
<tr>
<td height="74" bgcolor="#FFCE00">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="72" bgcolor="#FFFFFF"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="17%" height="72" valign="top" bgcolor="#FFFFCC" class="AlignementMiddleCenter"><img src="Images/Warning.gif" width="58" height="50">
<td width="83%" valign="top" bgcolor="#FFFFCC" class="ArialRed_12"><br>
We're
sorry, but there are no accounts associated with
the e-mail address you entered. Please make sure
that you have spelled correctly and click Retrieve
It when you are finished!
</table>
</table>
</table>
<% ELSE %>
<% END IF %>
<form method="POST" name="form" id="form" onSubmit="YY_checkform('form1[0]','username3','#S','2','Please use the e-mail format \'username@domain\'.');return document.MM_returnValue">
<table width="100%" border="0">
<tr>
<td width="15%" height="21" class="ArialBlackBold_12"><div align="right">
<p align="left" class="GeneralContentBold">E-mail Address:</p>
</div>
</td>
<td width="85%"><input name="Email" type="text" id="Email" size="30">
<input name="Submit" type="submit" id="Submit" value="Retrieve It!">
</td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
</table>
</form>
<p class="ArialBlack_12"> </p></td>
</tr>
</table></td>
</tr>
</table>