<%Response.Expires=0 if Session("ClientID") = "" then Session("Destination") = "clientservices.asp" Response.Redirect("logscr.asp") end if %> <% ErrorCode=0 ErrorText="" Response.Expires=0 if Session("ClientID") = "" then 'response.write("ID="& Session("ClientID")& "
") Session("Destination") = "cngclientpass.asp" Response.Redirect("cngclientpass.asp") end if if Request.form("txtOldPassword") <> "" then if ChangePassword() = True then Response.Redirect("cngpasclient.asp?Pchange=Yes") else if ErrorCode= 0 then Response.Redirect("cngpasclient.asp?Pchange=No") end if end if end if %> <% ConnectString="FILEDSN=sunraj.dsn" Set Conn=Server.CreateObject("ADODB.Connection") Set Rs=Server.CreateObject("ADODB.Recordset") Conn.Open ConnectString' SQL="select * from Clients where ClientID=" & session("ClientID") & ";" Rs.Open SQL, Conn %> Change Client Password

 
 
<%=ErrorText%>
User Name 
<% if not rs.eof then%> <%=rs.fields("ClientUserName")%> <% end if%>
Old Password 
" maxlength=20 size="15" type="password" >
New Password 
" maxlength=20 size="15" type="password" >
Reconfirm  Password 
" type="password" size="15" maxlength="20">

 
  Back

<% Function ChangePassword() if Request.form("txtOldPassword") <> "" then Set Conn=Server.createobject("ADODB.Connection") ConnectStr="FILEDSN=sunraj.dsn" Conn.Open ConnectStr SQL1 = "SELECT * FROM Clients WHERE ClientID = " & session("ClientID") & " and ClientPassword = '" + request.form("txtOldPassword") + "';" Set RS1=Server.createobject("ADODB.Recordset") RS1.Open SQL1,Conn if not RS1.EOF and not RS1.BOF then RS1.MoveFirst end if if RS1.EOF then ErrorCode=-6 ErrorText = "Invalid Old Password!!!" ChangePassword=False exit function end if RS1.close Conn.Close end if if Request.form("txtOldPassword") <> "" then Set Conn=Server.createobject("ADODB.Connection") ConnectStr="FILEDSN=sunraj.dsn" 'Jet OLEDB:Database Password=PRU2000" Conn.Open ConnectStr SQL2= "UPDATE Clients SET ClientPassword = '" + request.form("txtNewPassword") + "' WHERE ClientID=" & session("ClientID") & ";" Conn.Execute SQL2, RecAff if RecAff <> 1 then ChangePassword=False exit function end if ChangePassword=True Conn.Close else ChangePassword=False end if end function %>