<% dim conn 'database connection object dim rs 'recordset dim strSQL 'sql query dim endline 'set endline endline = chr(10) 'create the connection object set conn = Server.CreateObject("ADODB.Connection") 'open the connection conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=d:\home\hnt7c211\legacy\f7e8af3jk23sd3.mdb;" 'create a recordset set rs = Server.CreateObject("ADODB.Recordset") if Request.ServerVariables("REQUEST_METHOD") = "POST" then 'check the master password if not Request.Form("MasterPassword") = "raiders" then Session("responseString") = "That password is incorrect. " &_ "Return to " &_ "Manage Administrators" else 'set the sql statement strSQL = "SELECT ID FROM Users" 'set rs properties rs.LockType = adLockReadOnly 'run the query and save to rs rs.Open strSQL, conn 'loop through records, updating administrators Session("responseString") = "" dim admin, cb do while not rs.EOF cb = Request.Form("cb" & rs.Fields("ID")) 'update database strSQL = "UPDATE Users SET Is_Admin=""" & cb & """ WHERE ID=" & rs.Fields("ID") conn.Execute strSQL 'move to the next record rs.MoveNext loop rs.Close Session("responseString") = "The administrators have been updated.

" &_ "Return to Manage Administrators" end if 'redirect to form_submit Response.Redirect "form_submit.asp" end if %> Legacy Cruise II
<%=welcomeString%>

Legacy Cruise II departs in
Legacy Cruise II Administrators:
  <% 'set the sql statement strSQL = "SELECT Name,ID,Is_Admin FROM Users ORDER BY Name" 'run the query and save to rs rs.Open strSQL, conn if rs.EOF then response.write( "" ) else 'write results response.write( "" & endline ) response.write( "" & endline & "" & endline) do while not rs.EOF if ( Session("ID") = rs("ID") ) then response.write( "" ) else response.write( "" ) end if response.write( "" & endline ) rs.MoveNext loop response.write("" ) end if 'now close connection rs.Close set rs = Nothing set conn = Nothing %>
No one is in the database
NameAdministrator
" & rs("Name") & "
  
Master Password: