<%@LANGUAGE="VBSCRIPT"%> <% 'makesurepage is loaded within the site and memeber level is 2 or above if Session("Member_Level") < 2 then Response.Redirect "http://www.megascotland.co.uk" end if 'response.Write(Cstr(len(request.form))) 'initialise objects and variables dim aaaa, bbbb, todel, conn, strsql, rsuser, strMDBPath set conn=server.createobject("ADODB.Connection") set rsuser=server.createobject("ADODB.Recordset") rsuser.CursorType = 2 'Set the cursor type we are using so we can navigate through the recordset rsuser.LockType = 3 'Set the lock type so that the record is locked by ADO when it is updated if len(Request.Form("newcacher"))>2 then conn.open GetRegConnStr strsql = "SELECT * FROM addtoregistered" rsuser.open strsql, conn rsuser.addnew aaaa=Request.Form("newcacher") rsuser("team")=Request.Form("newcacher") 'Write the updated recordset to the database rsuser.Update rsuser.close 'close resources used conn.close end if if len(Request.Form("oldcacher"))>2 then bbbb=Request.Form("oldcacher") conn.open GetRegConnStr strsql = "SELECT * FROM addtoregistered where Team=" + "'"+Request.Form("oldcacher")+"'" rsuser.open strsql, conn if not rsuser.eof Then todel=1 rsuser.delete else todel=0 end if rsuser.close 'close resources used conn.close end if 'clean up set rsuser=nothing set conn=nothing %> Database update Page

 

ADDED:     <% if len(Request.Form("newcacher"))>2 then %><%=aaaa %><%else%> N/A <% end if%>
REMOVED:     <% if (len(Request.Form("oldcacher"))>2) and (todel=1) then %><%=bbbb %><%else%> N/A <% end if%>