Spam Filter ISP Support Forum

  New Posts New Posts RSS Feed - Error when trying to change password on ASP page
  FAQ FAQ  Forum Search   Register Register  Login Login

Error when trying to change password on ASP page

 Post Reply Post Reply
Author
Hillard Sarver View Drop Down
Guest Group
Guest Group
Post Options Post Options   Thanks (0) Thanks(0)   Quote Hillard Sarver Quote  Post ReplyReply Direct Link To This Post Topic: Error when trying to change password on ASP page
    Posted: 04 August 2003 at 2:48pm

Hello,

Have the registered version (1.2.0.190) and have everything working okay except when I try to change the user password from the web interface I get:

Microsoft JET Database Engine error '80040e14'

Syntax error in UPDATE statement.

?

I am using the MS Access database. All other web functions work (send, delete, view).  Thanks.

 

Back to Top
LogSat View Drop Down
Admin Group
Admin Group
Avatar

Joined: 25 January 2005
Location: United States
Status: Offline
Points: 4104
Post Options Post Options   Thanks (0) Thanks(0)   Quote LogSat Quote  Post ReplyReply Direct Link To This Post Posted: 04 August 2003 at 3:45pm

Hillard,

Is the error message you posted on the forum exactly as it appears on the browser? I'm asking since usually the line number that causes the error is reported along with the rest of the info, but it does not appear in your posting.

Roberto F.
LogSat Software 

Back to Top
Hillard Sarver View Drop Down
Guest Group
Guest Group
Post Options Post Options   Thanks (0) Thanks(0)   Quote Hillard Sarver Quote  Post ReplyReply Direct Link To This Post Posted: 04 August 2003 at 3:52pm

Yes the error is exactly as I did it in the post, I copied and pasted the entire browser window in the message.  I know I normally see line numbers also when I have gotten some ASP errors on other pages.

Great product by the way.

Happy Modeming

Hillard

 

Back to Top
Meister View Drop Down
Guest Group
Guest Group
Post Options Post Options   Thanks (0) Thanks(0)   Quote Meister Quote  Post ReplyReply Direct Link To This Post Posted: 05 August 2003 at 5:15am

Did you use any special character in the new or the old password (like apostrophe)?

(If yes, and you would like to use it, in the PasswordChange.asp change the lines below:

From (two-times):

 SQL = SQL & "WHERE EMail = '" & EmailTo & "'"

To:

SQL = SQL & "WHERE EMail = '" & Replace(EmailTo,"'","''") & "'"

And:

SQL = SQL & "SET Password = '" & NewPassword & "' "

To:

SQL = SQL & "SET Password = '" & Replace(NewPassword,"'","''") & "' "

 

Back to Top
Hillard Sarver View Drop Down
Guest Group
Guest Group
Post Options Post Options   Thanks (0) Thanks(0)   Quote Hillard Sarver Quote  Post ReplyReply Direct Link To This Post Posted: 05 August 2003 at 12:49pm

No not using special characters, edited anyhow as you showed just to see if it would help; however, it did not.  Any other things for me to look at or try?

Happy Modeming

Hillard

 

Back to Top
Hillard Sarver View Drop Down
Guest Group
Guest Group
Post Options Post Options   Thanks (0) Thanks(0)   Quote Hillard Sarver Quote  Post ReplyReply Direct Link To This Post Posted: 05 August 2003 at 1:39pm

Okay got it fixed.  Did some searching on web and found that the error message could happen if a reserved word was used in a field name, password was the problem.  So that a reserved word could be used  I changed:

SQL = SQL & "Set Password  =

TO:

SQL = SQL & "Set [Password] =

And that fixed the problem.

Happy Modeming

Hillard

 

Back to Top
Meister View Drop Down
Guest Group
Guest Group
Post Options Post Options   Thanks (0) Thanks(0)   Quote Meister Quote  Post ReplyReply Direct Link To This Post Posted: 07 August 2003 at 5:59am

What version os ADO and JET do you use?

What is the connection string?

(I think, you use ODBC, but the good is the native ADO-JET driver.)

 

 

Back to Top
Hillard Sarver View Drop Down
Guest Group
Guest Group
Post Options Post Options   Thanks (0) Thanks(0)   Quote Hillard Sarver Quote  Post ReplyReply Direct Link To This Post Posted: 07 August 2003 at 11:01am

I have a couple of versions for MDAC installed so a little hard to tell but if I am reading the component checker corretly looks like my ODBC comes from version 2.7.

Like I said it is working now that I made the change I posted before.

 

 

Back to Top
Meister View Drop Down
Guest Group
Guest Group
Post Options Post Options   Thanks (0) Thanks(0)   Quote Meister Quote  Post ReplyReply Direct Link To This Post Posted: 07 August 2003 at 11:18am

To know the ADO version save this to an "ado.vbs" file, and run it from command prompt:

On Error Resume Next
Set oConn = CreateObject("ADODB.Connection")
If Err.Number = 0 Then
      msgbox("ADO verzió : " + oConn.Version)
Else
      msgbox("Nincs ADOja!")
End If

Or right click on this file, and view the properties:

"C:\Program Files\Common Files\System\ado\msado15.dll"

 

But I think, you use ODBC.

The Microsoft says: Use the native JET driver.

The connectionstring to try this:

Provider=Microsoft.Jet.OLEDB.4.0;Password="";Data Source=C:\Program Files\SpamFilter\Database\SpamFilter.mdb;Persist Security Info=True

And the directory of the mdb must have access rights for IIS_USER. (Read, write...)

And if the problem exist after these, please write here, or send me the all SQL string.

(Write into the passwordchange.asp :

Before:

     SQL = "UPDATE tblLogins "
     SQL = SQL & "SET Password = '" & Replace(NewPassword,"'","''") & "' "
     SQL = SQL & "WHERE EMail = '" & Replace(EmailTo,"'","''") & "'"
     con.Execute SQL
     Response.Redirect "ListSpam.asp"

After:

     SQL = "UPDATE tblLogins "
     SQL = SQL & "SET Password = '" & Replace(NewPassword,"'","''") & "' "
     SQL = SQL & "WHERE EMail = '" & Replace(EmailTo,"'","''") & "'"
     response.write SQL
     'con.Execute SQL
     'Response.Redirect "ListSpam.asp"

 

 

 

 

Back to Top
Robert Gusnowski View Drop Down
Guest Group
Guest Group
Post Options Post Options   Thanks (0) Thanks(0)   Quote Robert Gusnowski Quote  Post ReplyReply Direct Link To This Post Posted: 15 November 2004 at 11:29pm

I too am struggling with getting the ASP page to change the password. I have tried everything that I can find in the forums, but what I end up with is and error message at the top of the password change box:

"UPDATE tblLogins SET [Password] = 'cat123' WHERE EMail = 'robegusn@central.btps.ca' "

I know that it is reading the "old" password because if I enter an incorrect password it gives the correct message - same goes if the "new" passwords don't match - I get an error message.  The problem seems to be updating the database with the new password.

The contents of my db_connect.asp:

Set con = Server.CreateObject("ADODB.Connection")
 con.ConnectionTimeout = 10
 con.CommandTimeout = 30
 con.CursorLocation = 3
 con.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\SpamFilter\Database\SpamFilter.mdb;Persist Security Info=False"

The contents of PasswordChange.asp:

<!--#include file="authenticate.asp"-->
<%
 EmailTo = Session("EmailTo")

 'Theoretically, this should never happen.
 If Len(EmailTo) < 1 Then
  Session("EmailTo") = Null
  Session.Abandon
  Response.Redirect "ListSpam.asp"
 End If

 OldPassword = Request.Form("OldPassword")

 If Len(OldPassword) Then
  NewPassword = Request.Form("NewPassword")
  ConfirmNewPassword = Request.Form("ConfirmNewPassword")

  If Len(NewPassword) < 6 Then
   ErrorMessage = "New Password was too short!"
  ElseIf NewPassword <> ConfirmNewPassword Then
   ErrorMessage = "New Password and Confirm New Password did not match!"
  ElseIf OldPassword = NewPassword Then
   ErrorMessage = "New Password was the same as Old Password!"
  Else
   SQL = "SELECT Password "
   SQL = SQL & "FROM tblLogins "
   SQL = SQL & "WHERE EMail = '" & EmailTo & "'"
   Set rs = con.Execute(SQL)

   If Not rs.EOF Then

    If rs("Password") <> OldPassword Then
     ErrorMessage = "Old Password was incorrect!"
    Else
     SQL = "UPDATE tblLogins "
          SQL = SQL & "SET Password = '" & Replace(NewPassword,"'","''") & "' "
          SQL = SQL & "WHERE EMail = '" & Replace(EmailTo,"'","''") & "'"
          response.write SQL
          'con.Execute SQL
          'Response.Redirect "ListSpam.asp"
    End If

   'This should also never happen.
   Else
    Session("EmailTo") = Null
    Session.Abandon
    Response.Redirect "ListSpam.asp"
   End If

  End If

 End If
%>
<html>
<head>
 <title>Spam Filter - Password Change Form</title>
</head>
<body>
 <form method="post" name="PasswordChange">
 <table align="center" border="1" cellpadding="1" cellspacing="1">
<%
 If Len(ErrorMessage) Then
%> 
  <tr>
   <td align="center" colspan="2"><span style="color:red"><%=ErrorMessage%></span></td>
  </tr>
<%
 End If
%>
  <tr>
   <td align="center" colspan="2">
    <h2>Password Change For</h2>
    <%=EmailTo%>
   </td>
  </tr>
  <tr>
   <td align="right">Old Password:</td>
   <td><input type="password" size="15" name="OldPassword"></td>
  </tr>
  <tr>
   <td align="right">New Password:</td>
   <td><input type="password" size="15" name="NewPassword"></td>
  </tr>
  <tr>
   <td align="right">Confirm New Password:</td>
   <td><input type="password" size="15" name="ConfirmNewPassword"></td>
  </tr>
  <tr>
   <td align="center" colspan="2">
    <input type="submit" value="Change Password">&nbsp;&nbsp;
    <input type="reset" value="Clear">
   </td>
  </tr>
 </table>
 </form>
</body>
</html>

I have also explicitly given the IIS (anonymous) user rights to the database and the directory containing the database.  Everything appears to be working except the change password feature.

I did make minor "cosmetic" changes to authenticate.asp, but since I can login I am assuming everything is OK.

If anyone can help with this - thanks in advance......

Robert

 

 

 

 

Back to Top
Robert Gusnowski View Drop Down
Guest Group
Guest Group
Post Options Post Options   Thanks (0) Thanks(0)   Quote Robert Gusnowski Quote  Post ReplyReply Direct Link To This Post Posted: 16 November 2004 at 5:05pm
I have solved the problem....
 
The correct code is:
 
     SQL = "UPDATE tblLogins "
     SQL = SQL & "SET [Password] = '" & Replace(NewPassword,"'","''") & "' "
     SQL = SQL & "WHERE EMail = '" & Replace(EmailTo,"'","''") & "'"
     con.Execute SQL
     Response.Redirect "ListSpam.asp"
 
Changing passwords now works.....
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down



This page was generated in 0.285 seconds.