<% 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

<% If Session("ewmsg") <> "" Then %>

<%= Session("ewmsg") %>

<% Session("ewmsg") = "" ' Clear message End If %> Membership of Gods Fair Maidens International
Our Vision.
Our Mission.
Our Statement of Faith.
Home page. All about our Ministry. Contact us. Our Programmes. Our Testimonies. Send in your Prayer Requests. Great Christian Websites.
Membership of Gods Fair Maidens International

Membership

The Ministry God's Fair Maidens is free and open to all adult, single parents, and young widows who are hurting and are in pains.

Registration Form

Names:
Contact Address:
E-mail Address:
Contact phone number(s):

Occupation:

Age:

Your Educational Qualification:
Please click the SUBMIT button only once,
then allow a few minutes for this process to be completed.
<% conn.Close ' Close Connection Set conn = Nothing %> <% '------------------------------------------------------------------------------- ' Function LoadData ' - Load Data based on Key Value ' - Variables setup: field variables Function LoadData() Dim sSql, rs, sWhere, sGroupBy, sHaving, sOrderBy sSql = "SELECT * FROM [Membership]" sWhere = "" sGroupBy = "" sHaving = "" sOrderBy = "" If sWhere <> "" Then sWhere = sWhere & " AND " sWhere = sWhere & "([ID] = " & AdjustSql(x_ID) & ")" sSql = sSql & " WHERE " & sWhere If sGroupBy <> "" Then sSql = sSql & " GROUP BY " & sGroupBy End If If sHaving <> "" Then sSql = sSql & " HAVING " & sHaving End If If sOrderBy <> "" Then sSql = sSql & " ORDER BY " & sOrderBy End If Set rs = Server.CreateObject("ADODB.Recordset") rs.Open sSql, conn If rs.Eof Then LoadData = False Else LoadData = True rs.MoveFirst ' Get the field contents x_ID = rs("ID") x_Surname = rs("Surname") x_Name = rs("Name") x_FamilyName = rs("FamilyName") x_Address = rs("Address") x_mail = rs("mail") x_phone = rs("phone") x_Occupation = rs("Occupation") x_Age = rs("Age") x_Qualification = rs("Qualification") End If rs.Close Set rs = Nothing End Function %> <% '------------------------------------------------------------------------------- ' Function AddData ' - Add Data ' - Variables used: field variables Function AddData() Dim sSql, rs, sWhere, sGroupBy, sHaving, sOrderBy Dim bCheckKey, sSqlChk, sWhereChk sSql = "SELECT * FROM [Membership]" sWhere = "" sGroupBy = "" sHaving = "" sOrderBy = "" ' Check for duplicate key bCheckKey = True sWhereChk = sWhere If x_ID = "" Or IsNull(x_ID) Then bCheckKey = False Else If sWhereChk <> "" Then sWhereChk = sWhereChk & " AND " sWhereChk = sWhereChk & "([ID] = " & AdjustSql(x_ID) & ")" End If If bCheckKey Then sSqlChk = sSql & " WHERE " & sWhereChk Set rsChk = conn.Execute(sSqlChk) If Not rsChk.Eof Then Session("ewmsg") = "Duplicate value for primary key" rsChk.Close Set rsChk = Nothing AddData = False Exit Function End If rsChk.Close Set rsChk = Nothing End If ' Add New Record If sWhere <> "" Then sWhere = sWhere & " AND " sWhere = sWhere & "(0 = 1)" sSql = sSql & " WHERE " & sWhere If sGroupBy <> "" Then sSql = sSql & " GROUP BY " & sGroupBy End If If sHaving <> "" Then sSql = sSql & " HAVING " & sHaving End If If sOrderBy <> "" Then sSql = sSql & " ORDER BY " & sOrderBy End If Set rs = Server.CreateObject("ADODB.Recordset") rs.CursorLocation = 3 rs.Open sSql, conn, 1, 2 rs.AddNew ' Field Surname sTmp = Trim(x_Surname) If Trim(sTmp) = "" Then sTmp = Null rs("Surname") = sTmp ' Field Name sTmp = Trim(x_Name) If Trim(sTmp) = "" Then sTmp = Null rs("Name") = sTmp ' Field FamilyName sTmp = Trim(x_FamilyName) If Trim(sTmp) = "" Then sTmp = Null rs("FamilyName") = sTmp ' Field Address sTmp = Trim(x_Address) If Trim(sTmp) = "" Then sTmp = Null rs("Address") = sTmp ' Field mail sTmp = Trim(x_mail) If Trim(sTmp) = "" Then sTmp = Null rs("mail") = sTmp ' Field phone sTmp = Trim(x_phone) If Trim(sTmp) = "" Then sTmp = Null rs("phone") = sTmp ' Field Occupation sTmp = Trim(x_Occupation) If Trim(sTmp) = "" Then sTmp = Null rs("Occupation") = sTmp ' Field Age sTmp = Trim(x_Age) If Trim(sTmp) = "" Then sTmp = Null rs("Age") = sTmp ' Field Qualification sTmp = Trim(x_Qualification) If Trim(sTmp) = "" Then sTmp = Null rs("Qualification") = sTmp rs.Update rs.Close Set rs = Nothing AddData = True End Function %>