Edit-Update records in ADO with ASP
am 19.12.2006 13:50:37 von iskofajardoOk. I want to create a control which i can Edit/Change the Password of
the user. Here is my codes but it was too long.
This is for Removing the previous data:
....
set conn = server.CreateObject ("ADODB.Connection")
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" &
server.MapPath ("users.mdb")
set rs = server.CreateObject ("ADODB.Recordset")
rs.Open "SELECT * FROM userlist", conn, 3, 3
do while not rs.EOF
if rs("password")=PassOld then
rs("password") = Delete
rs("DatenTime") = Delete
end if
rs.MoveNext
loop
response.redirect("changepass.asp?edit=editPass")
set rs=nothing
set conn=nothing
....
This is for Saving/Updating the record in my database:
....
set conn = server.CreateObject ("ADODB.Connection")
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" &
server.MapPath ("users.mdb")
set rs = server.CreateObject ("ADODB.Recordset")
rs.Open "SELECT password, DatenTime FROM userlist where password='"&
request.form("txtPass2") &"'", conn, 2,2
If rs.recordcount = 0 then
rs.Addnew
rs("password")=Password
rs("DatenTime")=now
rs.Update
set rs=nothing
set conn=nothing
end if
Response.Redirect("login.asp?login=creatednew")
....
Can you please help me again?