ASP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingASP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old May 20th, 2000, 11:33 AM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,575 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
RS Paging!! Need Urgent Help

<i><b>Originally posted by : Chris (bubbaman2000@hotmail.com)</b></i><br />Can anyone help me with RS paging. Here is my code<br /><br /><%@ Language="VBScript"%><br /><%Option Explicit%><br /><html><br /><head><br /><title>Interactive Business Directory Of Oman</title><br /><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><br /><%<br /> <br /> Dim BDSB<br /> Dim BDSV<br /> Dim VL<br /> <br /> Dim CNN<br /> Dim REC<br /> <br /> Dim STRSQL<br /> Dim X<br /> Dim Flag<br /> Dim PGCnt<br /> Dim PG<br /> Dim RECNO<br /> <br /> Flag = false<br /> X = False<br /> <br /> VL=trim(Request.QueryString("val"))<br /> BDSB=trim(Request.Form("BDSearchBy"))<br /> BDSV=trim(Request.Form("BDSearchVal"))<br /> <br /> Set CNN = server.CreateObject("ADODB.Connection")<br /> CNN.Provider="Microsoft.Jet.OLEDB.4.0"<br /> CNN.Open server.MapPath("../database/intom.mdb")<br /><br /> <br /> Set REC = Server.CreateObject("ADODB.Recordset")<br /> REC.CursorLocation = adUseClient<br />' REC.PageSize = 2<br /><br /> Sub RecWrite(PGE)<br /> %> <br /> <TABLE border=0 cellPadding=0 cellSpacing=0 width="100%"><br /> <%<br /> Response.Write(PGE)<br /> REC.AbsolutePage = PGE<br /> For RECNO = 1 to REC.PageSize%> <br /> <TR> <br /> <TD><Font color=#009999><Strong><Font color=#dc143c>Company Name : </font><%Response.write(REC.Fields("Company_Name"))%></Strong></Font></TD><br /> </TR><br /> <TR><br /> <TD><Font color=#009999><Strong><Font color=#dc143c>Location : </font><%Response.write(REC.Fields("Location"))%></Strong></Font></TD><br /> </TR><br /> <TR><br /> <TD><Font color=#009999><Strong><Font color=#dc143c>Business Hours : </font><%Response.write(REC.Fields("Business_Hrs"))%></Strong></Font></TD><br /> </TR><br /> <TR><br /> <TD><Font color=#009999><Strong><Font color=#dc143c>P. O. Box : </font><%Response.write(REC.Fields("POBox"))%></Strong></Font></TD><br /> </TR><br /> <TR><br /> <TD><Font color=#009999><Strong><Font color=#dc143c>Phone : </font><%Response.write(REC.Fields("Phone"))%></Strong></Font></TD><br /> </TR><br /> <TR><br /> <TD><Font color=#009999><Strong><Font color=#dc143c>Fax : </font><%Response.write(REC.Fields("Fax"))%></Strong></Font></TD><br /> </TR><br /> <TR><br /> <TD><Font color=#009999><Strong><Font color=#dc143c>Key Staff : </font><%Response.write(REC.Fields("KeyStaff"))%></Strong></Font></TD><br /> </TR><br /> <TR><br /> <TD><Font color=#009999><Strong><Font color=#dc143c>Email : </font><a href="mailto:<%= REC.Fields("Email")%>"><Font color="#000000"><%= rec.Fields("Email")%></Font></a></Strong></Font></TD><br /> </TR><br /> <br /> <TR><br /> <TD><HR width="100%"></TD><br /> </TR><br /> <%<br /> REC.MoveNext<br /> if REC.EOF = true then Exit For<br /> Next%><br /> </TABLE><%<br /> End Sub<br /> <br /> Sub NoRecWrite()%><br /> <TABLE border=0 cellPadding=0 cellSpacing=0 width=100%><br /> <TR> <br /> <TD><FONT face=Arial color="#cc0033"><STRONG> Select the Criteria you want to search by <br>Type in your value and Click on the above 'GO' button.</Strong></Font></TD><br /> </TR><br /> </TABLE><br /> <%End Sub%><br /><br /><Script Language="JavaScript"><br />function showDate()<br />{<br /> var dt = new Date();<br /> var month<br /> var year<br /> <br /> dt = new Date(); //Gets today's <FONT color=#ffffff style="BACKGROUND-COLOR: #0a246a">date</FONT> right now (to the millisecond).<br /> month = dt.getMonth()+1;<br /> day = dt.getDate();<br /> year = dt.getFullYear(); <br /> document.write(day + '/' + month + '/' + year);<br />}<br /><br /> function checker(val1, val2)<br /> {<br /> var val1len;<br /> var val2len;<br /> <br /> val1len=val1.length;<br /> val2len=val2.length;<br /> <br /> if (val1len == 0 || val2len == 0)<br /> {<br /> alert("Either one or both of the Fields are blank. Please Check");<br /> document.SearchBy.BDSearchBy.focus;<br /> return false;<br /> }<br /> else<br /> {<br /> return true;<br /> }<br /> }<br /></Script><br /><body link="#FFFFFF" bgcolor="#FFFFFF"><br /><table border="0" cellspacing="0" cellpadding="0" width="730"><br /> <TR valign="top"> <br /> <td width="100"><br /> <table border="0" cellspacing="0" cellpadding="0" width="100%"><br /> <tr valign="top"> <br /> <td> <br /> <table border="0" cellspacing="0" cellpadding="0"><br /> <tr> <br /> <td rowspan="2" valign="top"> </td><br /> <td rowspan="2" valign="center" align="middle"><img height=75 src="../images/iomlogo.gif" width=600></td><br /> <td valign="top"> </td><br /> </tr><br /> <tr> <br /> <td valign="center" align="right"> </td><br /> </tr><br /> </table><br /> </td><br /> </tr><br /> <tr valign="top"> <br /> <td valign=bottom><font face="Arial, Helvetica, sans-serif" size="3"><b><font size="4"><i> <br /> <font size="3"> Date : <br /> <script language="JavaScript">showDate()</script><br /> </font></i> </font> </b> </font></td><br /> </tr><br /> <tr valign="top"> <br /> <td> <br /> <table border="0" cellspacing="0" cellpadding="0" width="100%"><br /> <tr> <br /> <td valign="top"> <br /> <table width="120" border="0" cellspacing="0" cellpadding="0" bordercolorlight="#ffffff" bordercolordark="#ffffff"><br /> <tr bgcolor="#cc0033"> <br /> <td height="25"> </td><br /> </tr><br /> <tr bgcolor="#006699"> <br /> <td height="25"> <br /> <div align="center"><font face="Arial, Helvetica, sans-serif" size="1" color="#ffffff"><b><font size="3">Categories</font></b></font></div><br /> </td><br /> </tr><br /> <tr bgcolor="#ffcc00"> <br /> <td height="25"> <br /> <div align="center"><font size="2" face="Arial, Helvetica, sans-serif" color="#000000"><b><a href="../htm/auto.htm">Automobiles</a></b></font></div><br /> </td><br /> </tr><br /> <tr bgcolor="#ffcc00"> <br /> <td height="25"> <br /> <div align="center"><font size="2" face="Arial, Helvetica, sans-serif" color="#000000"><b>Banks <br /> & Finance</b></font></div><br /> </td><br /> </tr><br /> <tr bgcolor="#ffcc00"> <br /> <td height="25"> <br /> <div align="center"><font size="2" face="Arial, Helvetica, sans-serif" color="#000000"><b><a href="bizdirpg.asp">Business <br /> Directory</a></b></font></div><br /> </td><br /> </tr><br /> <tr bgcolor="#ffcc00"> <br /> <td height="25"> <br /> <div align="center"><font size="2" face="Arial, Helvetica, sans-serif" color="#000000"><b>Entertainment</b></font></div><br /> </td><br /> </tr><br /> <tr bgcolor="#ffcc00"> <br /> <td height="25"> <br /> <div align="center"><font size="2" face="Arial, Helvetica, sans-serif" color="#000000"><b>Kiddies <br /> Corner</b></font></div><br /> </td><br /> </tr><br /> <tr bgcolor="#ffcc00"> <br /> <td height="25"> <br /> <div align="center"><font size="2" face="Arial, Helvetica, sans-serif" color="#000000"><b>Technology</b></font></div><br /> </td><br /> </tr><br /> </table><br /> </td><br /> <td valign="top"> <br /> <table border="0" cellspacing="0" cellpadding="0"><br /> <tr valign="top" bgcolor="#cc0033"> <br /> <td height="25"><font face="Arial, Helvetica, sans-serif"><b><font size="3" color="#ffffff"> <br /> </font></b></font> <br /> <table border="0" cellspacing="0" cellpadding="0" height="25" bgcolor="#cc0033"><br /> <tr> <br /> <td width="2" height="25"> </td><br /> <td height="25"><font face="Arial, Helvetica, sans-serif"><b><font size="3" color="#ffffff">Interactive <br /> Business Directory Of OMAN</font></b></font></td><br /> </tr><br /> </table><br /> </td><br /> </tr><br /> <tr valign="top" bgcolor="#006699"> <br /> <td> <br /> <table border="1" cellspacing="0" cellpadding="0" width="100%" bordercolorlight="#FFFFFF" bordercolordark="#006699"><br /> <tr bgcolor="#006699" valign="center"> <br /> <td height="25" align="middle"> <br /> <div align="center"><font color="#ffffff"><b><font face="Arial, Helvetica, sans-serif" size="2"><a href="bizdirpg.asp?val=A">A</a></font></b></font></div><br /> </td><br /> <td height="25" align="middle"> <br /> <div align="center"><font color="#ffffff"><b><font face="Arial, Helvetica, sans-serif" size="2"><a href="bizdirpg.asp?val=B">B</a></font></b></font></div><br /> </td><br /> <td height="25" align="middle"> <br /> <div align="center"><font color="#ffffff"><b><font face="Arial, Helvetica, sans-serif" size="2"><a href="bizdirpg.asp?val=C">C</a></font></b></font></div><br /> </td><br /> <td height="25" align="middle"> <br /> <div align="center"><font color="#ffffff"><b><font face="Arial, Helvetica, sans-serif" size="2"><a href="bizdirpg.asp?val=D">D</a></font></b></font></div><br /> </td><br /> <td height="25" align="middle"> <br /> <div align="center"><font color="#ffffff"><b><font face="Arial, Helvetica, sans-serif" size="2"><a href="bizdirpg.asp?val=E">E</a></font></b></font></div><br /> </td><br /> <td height="25" align="middle"> <br /> <div align="center"><font color="#ffffff"><b><font face="Arial, Helvetica, sans-serif" size="2"><a href="bizdirpg.asp?val=F">F</a></font></b></font></div><br /> </td><br /> <td height="25" align="middle"> <br /> <div align="center"><font color="#ffffff"><b><font face="Arial, Helvetica, sans-serif" size="2"><a href="bizdirpg.asp?val=G">G</a></font></b></font></div><br /> </td><br /> <td height="25" align="middle"> <br /> <div align="center"><font color="#ffffff"><b><font face="Arial, Helvetica, sans-serif" size="2"><a href="bizdirpg.asp?val=H">H</a></font></b></font></div><br /> </td><br /> <td height="25" align="middle"> <br /> <div align="center"><font color="#ffffff"><b><font face="Arial, Helvetica, sans-serif" size="2"><a href="bizdirpg.asp?val=I">I</a></font></b></font></div><br /> </td><br /> <td height="25" align="middle"> <br /> <div align="center"><font color="#ffffff"><b><font face="Arial, Helvetica, sans-serif" size="2"><a href="bizdirpg.asp?val=J">J</a></font></b></font></div><br /> </td><br /> <td height="25" align="middle"> <br /> <div align="center"><font color="#ffffff"><b><font face="Arial, Helvetica, sans-serif" size="2"><a href="bizdirpg.asp?val=K">K</a></font></b></font></div><br /> </td><br /> <td height="25" align="middle"> <br /> <div align="center"><font color="#ffffff"><b><font face="Arial, Helvetica, sans-serif" size="2"><a href="bizdirpg.asp?val=L">L</a></font></b></font></div><br /> </td><br /> <td height="25"> <br /> <div align="center"><font color="#ffffff"><b><font face="Arial, Helvetica, sans-serif" size="2"><a href="bizdirpg.asp?val=M">M</a></font></b></font></div><br /> </td><br /> </tr><br /> <tr bgcolor="#006699" valign="center"> <br /> <td height="25" align="middle"> <br /> <div align="center"><font color="#ffffff"><b><font face="Arial, Helvetica, sans-serif" size="2"><a href="bizdirpg.asp?val=N">N</a></font></b></font></div><br /> </td><br /> <td height="25" align="middle"> <br /> <div align="center"><font color="#ffffff"><b><font face="Arial, Helvetica, sans-serif" size="2"><a href="bizdirpg.asp?val=O">O</a></font></b></font></div><br /> </td><br /> <td height="25" align="middle"> <br /> <div align="center"><font color="#ffffff"><b><font face="Arial, Helvetica, sans-serif" size="2"><a href="bizdirpg.asp?val=P">P</a></font></b></font></div><br /> </td><br /> <td height="25" align="middle"> <br /> <div align="center"><font color="#ffffff"><b><font face="Arial, Helvetica, sans-serif" size="2"><a href="bizdirpg.asp?val=Q">Q</a></font></b></font></div><br /> </td><br /> <td height="25" align="middle"> <br /> <div align="center"><font color="#ffffff"><b><font face="Arial, Helvetica, sans-serif" size="2"><a href="bizdirpg.asp?val=R">R</a></font></b></font></div><br /> </td><br /> <td height="25" align="middle"> <br /> <div align="center"><font color="#ffffff"><b><font face="Arial, Helvetica, sans-serif" size="2"><a href="bizdirpg.asp?val=S">S</a></font></b></font></div><br /> </td><br /> <td height="25" align="middle"> <br /> <div align="center"><font color="#ffffff"><b><font face="Arial, Helvetica, sans-serif" size="2"><a href="bizdirpg.asp?val=T">T</a></font></b></font></div><br /> </td><br /> <td height="25" align="middle"> <br /> <div align="center"><font color="#ffffff"><b><font face="Arial, Helvetica, sans-serif" size="2"><a href="bizdirpg.asp?val=U">U</a></font></b></font></div><br /> </td><br /> <td height="25" align="middle"> <br /> <div align="center"><font color="#ffffff"><b><font face="Arial, Helvetica, sans-serif" size="2"><a href="bizdirpg.asp?val=V">V</a></font></b></font></div><br /> </td><br /> <td height="25" align="middle"> <br /> <div align="center"><font color="#ffffff"><b><font face="Arial, Helvetica, sans-serif" size="2"><a href="bizdirpg.asp?val=W">W</a></font></b></font></div><br /> </td><br /> <td height="25" align="middle"> <br /> <div align="center"><font color="#ffffff"><b><font face="Arial, Helvetica, sans-serif" size="2"><a href="bizdirpg.asp?val=X">X</a></font></b></font></div><br /> </td><br /> <td height="25" align="middle"> <br /> <div align="center"><font color="#ffffff"><b><font face="Arial, Helvetica, sans-serif" size="2"><a href="bizdirpg.asp?val=Y">Y</a></font></b></font></div><br /> </td><br /> <td height="25" align="middle"> <br /> <div align="center"><font color="#ffffff"><b><font face="Arial, Helvetica, sans-serif" size="2"><a href="bizdirpg.asp?val=Z">Z</a></font></b></font></div><br /> </td><br /> </tr><br /> </table><br /> </td><br /> </tr><br /> <tr valign="top" bgcolor="#006699"> <br /> <td> <br /> <table border="0" cellspacing="0" cellpadding="0" width="100%"><br /> <tr> <br /> <td bgcolor="#006699"><font face="Arial, Helvetica, sans-serif" size="2" color="#ffffff"><b>Search <br /> under the following Categories : </b></font></td><br /> <td valign="top"> <br /> <table border="0" cellspacing="0" cellpadding="0" width="100%"><br /> <form name="SearchBy" action="bizdirpg.asp" method="post" onSubmit="return checker(BDSearchBy.value, BDSearchVal.value)"><br /> <tr valign="top"> <br /> <td colspan="2" align="middle" height="18"> <br /> <div align="center"> <br /> <select name="BDSearchBy"><br /> <option value="" selected></option><br /> <option value="Company_Name">Company Name</option><br /> <option value="Location">Location</option><br /> <option value="Phone">Phone</option><br /> <option value="Fax">Fax</option><br /> <option value="Email">Email</option><br /> <option value="KeyStaff">Key Staff</option><br /> </select><br /> </div><br /> </td><br /> </tr><br /> <tr> <br /> <td align="middle"> <br /> <input name="BDSearchVal" maxlength="200" size="35" ><br /> </td><br /> <td align="middle" valign="center"> <br /> <input type="image" border="0" cache name="Submit2" src="../images/gobttn.jpg" width="30" height="36" alt ="Click Here to search"><br /> </td><br /> </tr><br /> </form><br /> </table><br /> </td><br /> </tr><br /> </table><br /> </td><br /> </tr><br /> <tr valign="top"> <br /> <td> <br /> <table border="0" cellspacing="0" cellpadding="0" width="100%"><br /> <tr valign="top"> <br /> <td class="NormFont"><font <br /> face=Arial color="#cc0033"><strong>Search Results <br /> for : </strong></font> </td><br /> </tr><br /> <tr valign="top"> <br /> <td> <br /> <table border="0" cellspacing="0" cellpadding="0" width="100%"><br /> <tr> <br /> <td> </td><br /> <td> </td><br /> <td> </td><br /> </tr><br /> <tr> <br /> <td> </td><br /> <td valign="top"> <%<br /> if len(VL) <> 0 then<br /> STRSQL = "Select * From busdir where Company_Name like '" & VL & "%'"<br /> REC.Open STRSQL, CNN, adOpenStatic, adLockPessimistic, adCmdText<br /> REC.PageSize = 2<br /> PGCnt = REC.PageCount<br /> <br /> Select Case Request.Form("Action")<br /> case "<<"<br /> PG = 1<br /> case "<"<br /> PG = Request.Form("PG")-1<br /> if PG < 1 then PG = 1<br /> case ">"<br /> PG = Request("PG")+1<br /> if PG > PGCnt then PG = PGCnt<br /> Case ">>"<br /> PG = PGCnt<br /> case else<br /> PG = 1<br /> end select<br /> <br /> X = True<br /> RecWrite(PG) <br /> elseif len(BDSB) <> 0 and len(BDSV) <> 0 then<br /> STRSQL="Select * from busdir where " & BDSB & " like '%" & BDSV & "%'"<br /> REC.Open STRSQL, CNN, adOpenStatic, adLockPessimistic, adCmdText<br /> <br /> REC.PageSize = 2<br /> PGCnt = REC.PageCount<br /> <br /> Select Case Request("Action")<br /> case "<<"<br /> PG = 1<br /> case "<"<br /> PG = Request("PG")-1<br /> if PG < 1 then PG = 1<br /> case ">"<br /> PG = Request("PG")+1<br /> if PG > PGCnt then PG = PGCnt<br /> Case ">>"<br /> PG = PGCnt<br /> case else<br /> PG = 1<br /> end select<br /> <br /> X = True<br /> RecWrite(PG) <br /> elseif len(BDSB) = 0 or len(BDSV) = 0 then<br /> X = False<br /> NoRecWrite()<br /> end if<br /> %> </td><br /> <td> </td><br /> </tr><br /> <tr> <br /> <td> </td><br /> <td> </td><br /> <td> </td><br /> </tr><br /> </table><br /> </td><br /> </tr><br /> </table><br /> </td><br /> </tr><br /> </table><br /> </td><br /> <td valign="top"><br /> <table border="0" cellspacing="0" cellpadding="0" width="120"><br /> <tr valign="middle" align="center" bgcolor="#CC0033"> <br /> <td height="25"> <b><font face="Arial, Helvetica, sans-serif" size="1" color="#FFFFFF">Search <br /> Powered by :</font></b></td><br /> </tr><br /> <tr align="center" valign="middle"> <br /> <td><img src="../images/yahoo.jpg" height="30"></td><br /> </tr><br /> <form name="Yhsearch" action="http://search.yahoo.com/bin/search"><br /> <tr align="center" valign="middle"> <br /> <td> <br /> <input type="text" name="p" maxlength="255" size="20"><br /> </td><br /> </tr><br /> <tr valign="middle" align="center"> <br /> <td> <br /> <input type="submit" name="Submit" value="INTERACT"><br /> </td><br /> </tr><br /> </form><br /> </table><br /> </td><br /> </tr><br /> </table><br /> </td><br /> </tr><br /> </table><br /> </TD><br /> </TR></TABLE><br /><%<br /> If X = True then<br /> REC.Close<br /> Set REC = Nothing<br /> CNN.Close<br /> Set CNN = Nothing<br />end if<br />%><br /> <br /><form name="MovePage" action="bizdirpg.asp" method="post"><br /> <input type="hidden" name="PG" value="<%=PG%>"><br /> <input type="submit" name="action" value="<<"><br /> <input type="submit" name="action" value="<"><br /> <input type="submit" name="action" value=">"><br /> <input type="submit" name="action" value=">>"><br /> <br><br /> Page: <%=PG & " of " & PGCnt%><br /></form><br /><%<br /> Response.Write("<P>" & BDSV & " " & BDSB & "<br>")<br /> Response.Write(VL)<br />%><br /></body><br /><br /></html><br /><br />

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingASP Development > RS Paging!! Need Urgent Help


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump





 Free IT White Papers!
 
Create the Optimal Architecture for your Critical Applications
Warburton's the largest independently owned bakery in the UK faced a number of difficult challenges in providing the most robust yet efficient IT infrastructure for their organization's success. IBM's services combined with their xSeries servers created the perfect platform for their SAP environment with sufficient flexibility, and did so in very time effective fashion.

 
Five Best Practices for Deploying a Successful Service-Oriented Architecture
This white paper describes the benefits you can expect with SOA, and how IBM can help take your business there.

 
Gartner Magic Quadrant for Application Delivery Controllers
Gartner summarizes its view on Application Delivery Controllers, evaluates strengths and weaknesses of solutions, and provides Magic Quadrant reporting for a quick comparison across all vendors. Learn from Gartner how you can benefit from an all-in-one device like Citrix NetScaler that delivers the highest levels of availability, performance and security.

 
Knowledge is Power
What you don't know can hurt you, and is likely costing you money and increasing your security risks during an era of scarce resources. This white paper proposes six key strategies that enterprise security managers can use to improve their network defense posture.

 
Rationalizing the Multi-Tool Environment
The rationalized multi-tool approach is flexible, scalable and cost effective. It provides the necessary input to the IT service management business processes. It preserves prior investments in monitoring tools, empowers technologists to select the best tools with which to do their jobs, and enhances effective response to incidents.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2010 by Developer Shed. All rights reserved. DS Cluster 7 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek