% Response.expires = 0 Response.expiresabsolute = Now() - 1 Response.addHeader "pragma", "no-cache" Response.addHeader "cache-control", "private" Response.addHeader "cache-control", "no-cache" Response.addHeader "cache-control", "no-store" Response.CacheControl = "no-cache" %> <% ewCurSec = 0 ' Initialise ' User levels Const ewAllowAdd = 1 Const ewAllowDelete = 2 Const ewAllowEdit = 4 Const ewAllowView = 8 Const ewAllowList = 8 Const ewAllowReport = 8 Const ewAllowSearch = 8 Const ewAllowAdmin = 16 %> <% ' Initialize common variables x_ID = Null: ox_ID = Null x_Surname = Null: ox_Surname = Null x_Name = Null: ox_Name = Null x_FamilyName = Null: ox_FamilyName = Null x_Address = Null: ox_Address = Null x_mail = Null: ox_mail = Null x_phone = Null: ox_phone = Null x_Occupation = Null: ox_Occupation = Null x_Age = Null: ox_Age = Null x_Qualification = Null: ox_Qualification = Null %> <% Response.Buffer = True ' Load key from QueryString bCopy = True x_ID = Request.QueryString("ID") If x_ID = "" Or IsNull(x_ID) Then bCopy = False End If ' Get action sAction = Request.Form("a_add") If (sAction = "" Or IsNull(sAction)) Then If bCopy Then sAction = "C" ' Copy record Else sAction = "I" ' Display blank record End If Else ' Get fields from form x_ID = Request.Form("x_ID") x_Surname = Request.Form("x_Surname") x_Name = Request.Form("x_Name") x_FamilyName = Request.Form("x_FamilyName") x_Address = Request.Form("x_Address") x_mail = Request.Form("x_mail") x_phone = Request.Form("x_phone") x_Occupation = Request.Form("x_Occupation") x_Age = Request.Form("x_Age") x_Qualification = Request.Form("x_Qualification") End If ' Open connection to the database Set conn = Server.CreateObject("ADODB.Connection") conn.Open xDb_Conn_Str Select Case sAction Case "C": ' Get a record to display If Not LoadData() Then ' Load Record based on key Session("ewmsg") = "No records found" conn.Close ' Close Connection Set conn = Nothing Response.Clear Response.Redirect "membership-confirmation.htm" End If Case "A": ' Add If AddData() Then ' Add New Record Session("ewmsg") = "Add New Record Successful" conn.Close ' Close Connection Set conn = Nothing Response.Clear Response.Redirect "membership-confirmation.htm" Else End If End Select %>
Add to TABLE: Membership
Back to List
<%= Session("ewmsg") %>
<% Session("ewmsg") = "" ' Clear message End If %>