Error when trying to change password on ASP page |
Post Reply ![]() |
Author | |
Hillard Sarver ![]() Guest Group ![]() |
![]() ![]() ![]() ![]() ![]() 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.
|
|
![]() |
|
LogSat ![]() Admin Group ![]() ![]() Joined: 25 January 2005 Location: United States Status: Offline Points: 4104 |
![]() ![]() ![]() ![]() ![]() |
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. |
|
![]() |
|
Hillard Sarver ![]() Guest Group ![]() |
![]() ![]() ![]() ![]() ![]() |
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
|
|
![]() |
|
Meister ![]() Guest Group ![]() |
![]() ![]() ![]() ![]() ![]() |
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,"'","''") & "' "
|
|
![]() |
|
Hillard Sarver ![]() Guest Group ![]() |
![]() ![]() ![]() ![]() ![]() |
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
|
|
![]() |
|
Hillard Sarver ![]() Guest Group ![]() |
![]() ![]() ![]() ![]() ![]() |
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
|
|
![]() |
|
Meister ![]() Guest Group ![]() |
![]() ![]() ![]() ![]() ![]() |
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.)
|
|
![]() |
|
Hillard Sarver ![]() Guest Group ![]() |
![]() ![]() ![]() ![]() ![]() |
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.
|
|
![]() |
|
Meister ![]() Guest Group ![]() |
![]() ![]() ![]() ![]() ![]() |
To know the ADO version save this to an "ado.vbs" file, and run it from command prompt: On Error Resume Next 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 " After: SQL = "UPDATE tblLogins "
|
|
![]() |
|
Robert Gusnowski ![]() Guest Group ![]() |
![]() ![]() ![]() ![]() ![]() |
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") The contents of PasswordChange.asp: <!--#include file="authenticate.asp"--> 'Theoretically, this should never happen. OldPassword = Request.Form("OldPassword") If Len(OldPassword) Then If Len(NewPassword) < 6 Then If Not rs.EOF Then If rs("Password") <> OldPassword Then 'This should also never happen. End If End If 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
|
|
![]() |
|
Robert Gusnowski ![]() Guest Group ![]() |
![]() ![]() ![]() ![]() ![]() |
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.....
|
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
This page was generated in 0.285 seconds.