%
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 departs in |
|||||||||||
Home | Register & Vote | History | Attendees | Pictures | Guestbook | Links | Feedback | ||||
|
Account Management
Email Newsletter
Voting Results
Copyright © 2005 Legacy Cruise Productions. All Rights Reserved.