%
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
'save this site to the database
strSQL = "SELECT * FROM Sites"
'set rs properties
rs.CursorType = adOpenDynamic 'to move dynamically through rs
rs.LockType = adLockOptimistic 'to lock the recordset while updating
'run the query
rs.Open strSQL, conn
dim match
match = false
do while not rs.EOF
if rs.Fields("Website") = Request.Form("Website") then
match = true
exit do
end if
rs.MoveNext
loop
if match then
Session("responseString") = "We're sorry, but that website is already on the list!"
else
'add a new record
rs.AddNew
'now add the fields
rs.Fields("FirstName") = Request.Form("FirstName")
rs.Fields("LastName") = Request.Form("LastName")
rs.Fields("Website") = Request.Form("Website")
'write to the database
rs.Update
Session("responseString") = "Your website has been added to the list of Links.
"
end if
'close the database connection
rs.Close
'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.