<%@ Language=VBScript %> <% Option Explicit %> <% Response.Buffer = True %> Wedding Guest Book <% Dim objRS, strUsername, strComments strUsername = Trim(Request("Name")) strComments = Trim(Request("Comments")) If strUsername <> "" Then Set objRS = Server.CreateObject("ADODB.Recordset") objRS.Open "SGWedList", objConn, , adLockOptimistic, adCmdTable objRS.AddNew objRS("Name") = Request.Form("Name") objRS("Comments") = Request.Form("Comments") objRS("IP") = Request.ServerVariables("REMOTE_ADDR") objRS.Update objRS.Close End If 'Now with database open set SQL commamnd to choose comments in date order and then display the table 'Remember to include database files 'Need to create a DSN with name SGWedList - fields Name, comments, IP and Date (optional email). %>

Please Sign Our Guest Book
[click here]

<% Dim strSQL strSQL = "SELECT * FROM SGWedList ORDER BY date DESC " Set objRS = Server.CreateObject("ADODB.Recordset") objRS.Open strSQL, objConn %> <% Do While Not objRS.EOF %> <% objRS.MoveNext Loop objRS.Close Set objRS = Nothing objConn.Close Set objConn = Nothing %>
<%=objRS("Name") %>
<%=objRS("Comments") %>