<%@ Language=VBScript %> <% Option Explicit %> <% 'variable declaration and initalization Dim rqtextfield,rqtextfield1,sql,strSQL,sPageHeading,sMessage,sPageName,nPagesize,sPaging rqtextfield=trim(Form_call(request("textfield"))) rqtextfield1=trim(request("textfield")) Dim rqDescription,j,cn Dim paths paths="http://weddingfavorsnow.com/" %> <% 'Open Connection Dim DSN DSN="Provider=SQLOLEDB.1;Persist Security Info=False;User ID=weddingff;Password=paynt*kan;initial catalog=weddingff;Data Source=sh02.arsalon.net" Set cn = Server.CreateObject("ADODB.Connection") cn.Open DSN if rqtextfield="" then Response.Redirect "default.asp" end if %> Wedding Favor Finder - Result
  <% rs1.movenext() end if Next else%> <%'Response.Write "We were not able to find any web page that contained" & ":" %> <%end if %> <% call TableEnd()%>
Search Again

<% call TableBegin(sPageHeading,sMessage)%> <% '-------- call to paging function ------------- 'for default display strSQL="select * from favors where Name like '%"&rqtextfield&"%' or Categories like '%"&rqtextfield&"%' or Details like '%"&rqtextfield&"%' or Description like '%"&rqtextfield&"%' or Keywords like '%"&rqtextfield&"%'" sPageName="second.asp" nPagesize=10 Dim iPageSize 'How big our pages are Dim iPageCount 'The number of pages we get back Dim iPageCurrent 'The page we want to show Dim strOrderBy 'A fake parameter used to illustrate passing them Dim strs4QL 'SQL command to execute Dim iRecordsShown 'Loop controller for displaying just iPageSize records Dim I 'Standard looping var Dim rs1 ' Get parameters4 iPageSize = cint(nPagesize) ' You could easily allow users4 to change this ' Retrieve page to show or default to 1 If Request.QueryString("page") = "" Then iPageCurrent = 1 Else iPageCurrent = cdbl(Request.QueryString("page")) End If ' Open rs set rs1=server.CreateObject("ADODB.recordset") rs1.CursorLocation = 3 rs1.Open strSQL,cn,1,3 if not rs1.eof then rs1.PageSize = iPageSize ' You can change other settings as with any rs44 rs1.CacheSize = iPageSize ' Get the count of the pages using the given page size iPageCount = rs1.PageCount ' If the request page falls outside the acceptable range, ' give them the closest match (1 or max) If iPageCurrent > iPageCount Then iPageCurrent = iPageCount If iPageCurrent < 1 Then iPageCurrent = 1 ' Check page count to prevent bombing when zero results are returned! ' Move to the selected page rs1.AbsolutePage = iPageCurrent ' Start output with a page x of n line ' Show "previous" and "next" page links which pass the page to view ' and any parameters4 needed to rebuild the query. You could just as ' easily use a form but you'll need to change the lines that read ' the info back in at the top of the script. dim pageshow pageshow="" If iPageCurrent > 1 Then pageshow=" << " End If pageshow=pageshow &"Page "&""&iPageCurrent&""&" of "&""&iPageCount&"" If iPageCurrent < iPageCount Then pageshow = pageshow & " >> " End If sPaging=pageshow end if '---------- Display Records -------------- if not (rs1.EOF) then For j=1 To nPagesize if not (rs1.EOF) then %>
" > border="0">
"><%=rs1("Name")%>
" class="simplelink"><%=rs1("Description")%>
<%=mid(rs1("Details"),1,200)&"....." %>
 
Sorry! No result found with : <%=rqtextfield%>
<%=sPaging%>
 
   
 
© 2006 Wedding Favors Finder