<% 'no security checking %>
<%
Response.expires = 0
Response.expiresabsolute = Now() - 1
Response.addHeader "pragma", "no-cache"
Response.addHeader "cache-control", "private"
Response.CacheControl = "no-cache"
%>
<%
response.buffer = true
'get action
a=request.form("a")
'get fields from form
x_id = Request.Form("x_id")
x_Name = Request.Form("x_Name")
x_Country = Request.Form("x_Country")
x_Email = Request.Form("x_Email")
x_URL = Request.Form("x_URL")
x_Comments = Request.Form("x_Comments")
' Open Connection to the database
set conn = Server.CreateObject("ADODB.Connection")
conn.Open xDb_Conn_Str
Select Case a
Case "A": ' Add
' Open record
strsql = "SELECT * FROM [guestbook] WHERE 0 = 1"
set rs = Server.CreateObject("ADODB.Recordset")
rs.Open strsql, conn, 1, 2
rs.AddNew
tmpFld = Trim(x_Name)
If trim(tmpFld) & "x" = "x" Then tmpFld = Null
rs("Name") = tmpFld
tmpFld = Trim(x_Country)
If trim(tmpFld) & "x" = "x" Then tmpFld = Null
rs("Country") = tmpFld
tmpFld = Trim(x_Email)
If trim(tmpFld) & "x" = "x" Then tmpFld = Null
rs("Email") = tmpFld
tmpFld = Trim(x_URL)
If trim(tmpFld) & "x" = "x" Then tmpFld = Null
rs("URL") = tmpFld
tmpFld = Trim(x_Comments)
If trim(tmpFld) & "x" = "x" Then tmpFld = Null
rs("Comments") = tmpFld
rs.Update
rs.Close
Set rs = Nothing
conn.Close
Set conn = Nothing
Response.Clear
Response.Redirect "index1.html"
End Select
%>