% dim RS dim MyConn Set MyConn = Server.CreateObject("ADODB.Connection") MyConn.Open Application("Database1_ConnectionString") Set RS = Server.CreateObject ("ADODB.Recordset") %> <% strSQL = "SELECT * FROM QOTD" RS.Open strSQL, MyConn, 3 RS.MoveFirst 'if (request.cookies("qotdnum") = "") then ' response.cookies("qotdnum") = 0 ' response.cookies("qotdnum").expires=Date+30 'End If k=0 x=0 if (request.cookies("qotdnum") <> "") Then x=request.cookies("qotdnum") end if For k = 0 to x If (NOT RS.EOF) Then RS.MoveNext k=k+1 End If Next response.cookies("qotdnum")=k response.cookies("qotdnum").expires=Date+30 if (RS.EOF) then response.cookies("qotdnum")=0 RS.MoveFirst End If %>
Famous quotations:
<%
Response.Write " "
Response.Write (RS("text"))
Response.Write " "
Response.Write (RS("author"))
Response.Write "
<% RS.Close MyConn.Close Set MyConn = nothing %>