HELP!! ASP Change Password.

Discussion in 'C#' started by zhyke08, Aug 17, 2009.

Thread Status:
Not open for further replies.
  1. #1
    Hi there! i am new in ASP programming. Can someone help me to make a program on how to change a password of a user? I have this code but it has an error. Thanks.:)

    <%
    dim xUname, xOldPword, xNewPword, xConNewPword
    dim conn,rs


    xUname=server.htmlencode(request.Form("txtUName"))
    xOldPword=server.htmlencode(request.Form("txtOldPword"))
    xNewPword=server.htmlencode(request.Form("txtNewPword"))
    xConNewPword=server.htmlencode(request.Form("txtConNewPword"))


    if ((xUname = "") or (xOldPword = "") or (xNewPword = "") or (xConNewPword = "")) Then
    response.write "Blank entry not allowed!"
    response.end
    end if


    if xNewPword <> xConNewPword then

    response.write "New Password not Match"
    response.end


    End if

    set conn=server.createobject("Adodb.connection")
    conn.provider="Microsoft.jet.oledb.4.0"
    conn.connectionstring=server.mappath("Account.mdb")
    conn.open

    set rs=server.createobject("Adodb.recordset")
    rs.open "Select * from tblPassword where Uname='" & (xUname) & "' and Pword= '" & (xoldPword) & "'",conn,1,3


    if not rs.eof = true then
    rs("Pword") = xNewPword
    rs.update



    else

    Response.write "Invalid User or Password"
    response.end

    end if


    rs.close
    set rs=nothing
    set conn=nothing

    response.redirect "Login.asp"
    %>
     
    zhyke08, Aug 17, 2009 IP
  2. mansite2003@yahoo.com

    mansite2003@yahoo.com Peon

    Messages:
    35
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    what is the error please post the error....
     
    mansite2003@yahoo.com, Aug 18, 2009 IP
  3. zhyke08

    zhyke08 Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks for the reply. this is already resolved. No problem in the code. only the permission in the server. Thanks nyways.
     
    zhyke08, Aug 18, 2009 IP
  4. sibangor

    sibangor Peon

    Messages:
    6
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    problem is solved
     
    sibangor, Aug 28, 2009 IP
Thread Status:
Not open for further replies.