|
Libro de visitas del SAAS
<% PageNo = request("page")
If PageNo="" then
%>
<%
PageNo=1
ElseIf PageNo=1 then
%>
<%
Else
%>
<%
End If
set conn = server.createobject("adodb.connection")
DSNtemp="DRIVER={Microsoft Access Driver (*.mdb)}; "
' set the actual path to the guestbook below - this example
' assumes that the guestbook is in the web server root
DSNtemp=dsntemp & "DBQ=" & server.mappath("/guestbook/saas_Guestbook.mdb")
conn.Open DSNtemp
sqlstmt = "SELECT * from Guestbook ORDER BY PostDate DESC"
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open sqlstmt, conn, 3, 3
TotalRecs = rs.recordcount
rs.Pagesize=5
TotalPages = cInt(rs.pagecount)
rs.absolutepage=PageNo
If PageNo = 1 then
response.write " Hay " & TotalRecs & " subscripciones en " & TotalPages & " páginas"
End If
If rs.eof then
response.write "
No hay subscripciones en el Libro de visitas."
response.write " Firma nuestro Libro de Visitas"
response.end
End If
x = 0
For x = 1 to 5
If rs.eof then
Exit For
Else
When = rs("PostDate")
Name = rs("Name")
Name = Replace(Name,"''","'")
City = rs("City")
State = rs("State")
Country = rs("Country")
Email = rs("Email")
URL = rs("URL")
If IsEmpty(URL) or URL = "" then
Link = "no URL given"
Else
Link = "" & URL & ""
End If
Comments = rs("Comments")
Comments = replace(Comments, "''", "'")
Start = rs("PostDate")
%>
| <%= When %> |
|
<%= Comments %>
|
|
<%
If IsEmpty(Email) or Email="" then
response.write(Name)
Else
response.write "" & Name & ""
End If
%>
|
<%= City %>
<%= State %> <%= Country %>
|
<%= Link %>
|
<%
rs.MoveNext
End If
Next
response.write ""
response.write "| "
If PageNo > 1 then
response.write ""
Else
response.write " "
End If
response.write " | "
If NOT rs.eof then
response.write ""
Else
response.write " "
End If
response.write " | "
conn.close
set conn = nothing
%>
|
 |
|