<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%> <% ' check if this is a fresh load or a Submit. 'response.Write("*" & Request.Form("btnSubmit") & "*") if Request.Form("txtName") <> "" then 'add record to DB 'response.Write("Adding...") Dim rstAdd Set rstAdd = Server.CreateObject("ADODB.Recordset") rstAdd.ActiveConnection = MM_cnnGENERIC_STRING rstAdd.Source = "SELECT * FROM Guests" rstAdd.CursorType = 2 rstAdd.CursorLocation = 3 rstAdd.LockType = 3 rstAdd.Open() rstAdd.AddNew rstAdd("Name")=Request.Form("txtName") rstAdd("Location")=Request.Form("lstCountries") rstAdd("EmailAddress")=Request.Form("txtEmail") rstAdd("DateStamp")=Request.Form("hidDate") rstAdd("Remarks")=Request.Form("memRemark") rstAdd("UserName") = Request.ServerVariables("REMOTE_USER") rstAdd("RemoteIP") = request.ServerVariables("REMOTE_ADDR") rstAdd("RemoteHost") = request.ServerVariables("REMOTE_HOST") rstAdd.Update rstAdd.Close() set rstAdd=Nothing end if %> <% Dim rstGuests Dim rstGuests_numRows Set rstGuests = Server.CreateObject("ADODB.Recordset") rstGuests.ActiveConnection = MM_cnnGENERIC_STRING rstGuests.Source = "SELECT * FROM Guests ORDER BY DateStamp DESC" rstGuests.CursorType = 2 rstGuests.CursorLocation = 2 rstGuests.LockType = 1 rstGuests.Open() rstGuests_numRows = 0 'quickly loop thru recordset to retrieve recordcount dim Cnt Cnt = 0 if NOT (rstGuests.BOF AND rstGuests.EOF) then While NOT rstGuests.EOF Cnt = Cnt + 1 rstGuests.MoveNext Wend rstGuests.MoveFirst end if %> <% Dim Repeat1__numRows Dim Repeat1__index Repeat1__numRows = -1 Repeat1__index = 0 rstGuests_numRows = rstGuests_numRows + Repeat1__numRows %>











Enter your email address to join our mailing list

...guestbook    

 

Click here to view reader comments

 

<% if Request.Form("txtName") <> "" then %> Thank you for signing our guestbook. We appreciate your comments and suggestions. <% end if %>  

Name:
Email Address:
Country:
Remarks:
 
 
 

 

 

A Sphinx Interactive Design 

<% rstGuests.Close() Set rstGuests = Nothing %>