joelo
12-01-2003, 09:20 AM
what I am trying to do is:...I have a users table and list of user...one user is assigned to different facility
ie
Lname Fname UID Pword Facility
GOO MOO M MEE LAG
GOO MOO M MEE MAG
GOO MOO M MEE WAG
I want to be able change Pword all at same time
I don't know if I am making any sense
This is my code:
-------------------
Set conn = Server.CreateObject("ADODB.Connection")
conn.open xDb_Conn_Str
strsql = "select all * from [usersdatabase]" _
& " where userid = '" & Session("userid") & "' AND lastname = '" & session("lastname") & "' AND firstname = '" & session("firstname") & "'"
set rs = Server.CreateObject("ADODB.Recordset")
rs.Open strsql, conn, 1, 2
if (rs.BOF and rs.EOF) then
Response.Write("<font size='3' color='red'><b>Userid '" & userid & "' not found, try again.....</b></font><p>")
elseif Request.form("password") <> rs("PASSWORD") then
Response.Write("<font size='3' color='red'><b>Incorrect Current password, Please try again....</b></font><p>")
else
'Update record with new password.
rs("USERID") = Session("userid")
rs("PASSWORD") = Request.Form("newpass1")
rs.Update
rs.Close
Set rs = Nothing
conn.Close
Set conn = Nothing
Response.Write("<font size='3' color='red'><b>Your password has been successfully changed.....Thank You</b></font><p>")
end if
end if
end if
ie
Lname Fname UID Pword Facility
GOO MOO M MEE LAG
GOO MOO M MEE MAG
GOO MOO M MEE WAG
I want to be able change Pword all at same time
I don't know if I am making any sense
This is my code:
-------------------
Set conn = Server.CreateObject("ADODB.Connection")
conn.open xDb_Conn_Str
strsql = "select all * from [usersdatabase]" _
& " where userid = '" & Session("userid") & "' AND lastname = '" & session("lastname") & "' AND firstname = '" & session("firstname") & "'"
set rs = Server.CreateObject("ADODB.Recordset")
rs.Open strsql, conn, 1, 2
if (rs.BOF and rs.EOF) then
Response.Write("<font size='3' color='red'><b>Userid '" & userid & "' not found, try again.....</b></font><p>")
elseif Request.form("password") <> rs("PASSWORD") then
Response.Write("<font size='3' color='red'><b>Incorrect Current password, Please try again....</b></font><p>")
else
'Update record with new password.
rs("USERID") = Session("userid")
rs("PASSWORD") = Request.Form("newpass1")
rs.Update
rs.Close
Set rs = Nothing
conn.Close
Set conn = Nothing
Response.Write("<font size='3' color='red'><b>Your password has been successfully changed.....Thank You</b></font><p>")
end if
end if
end if