< %
if Request.ServerVariables("REQUEST_METHOD") = "POST" then
iGuestID = Request.Form("txtID")
sGuestEmail = Request.Form("txtEmail")
if iGuestID < > "" and sGuestEmail < > "" then
'在資料庫中更新使用者記錄
strSQL_UnSubs = "UPDATE Guests SET Guests.Mail_List=" & 0 & _
" WHERE Guests.Guest_ID=" & iGuestID & _
" AND Guests.Guest_Email='" & sGuestEmail & "';"
Set oConn = Server.CreateObject("ADODB.Connection")
oConn.Open strDSNPath
oConn.Execute strSQL_UnSubs, iUpdates
on error resume next
oConn.Close
Set oConn = Nothing
if err.number < > 0 then
sError = ...SQL語句執行失敗提示資訊, 略...
else
if iUpdates < > 0 then
sError = ...取消訂閱成功提示資訊,略...
else
sError = ...不能找到資料庫記錄提示資訊,略...
end if 'iUpdates < > 0
end if 'err.number < > 0
else
Response.Redirect("homepage.htm")
end if 'iGuestID < > ""
end if 'REQUEST_METHOD = "POST"
%>