SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseSQL 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 August 11th, 2004, 10:20 AM
Damiano3 Damiano3 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Posts: 4 Damiano3 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question Recordset Problem with Absolutepage and adOpenStatic PLEASE HELP !!!!!!

I have this script for navigating through a recordset, it all works fine,
except when I click to move to the next page
it displays all results again rather than the results only for that page.

I've tried every combination of Record cursor types etc. and still no joy.

Could someone please help me.

Kind Regards

Damiano3


<%@ LANGUAGE="VBScript" %>
<% Option Explicit %>
<!--#INCLUDE FILE="adovbs.inc"-->
<%
Dim pg, numpages, numrecs, pagesize, rowCount
Dim theConnection,prodRS, sqlString,conString

pg = TRIM( Request( "pg" ) )
IF pg = "" THEN pg = 1
If pg > numpages Then pg = numpages
If pg < 1 Then pg = 1

pagesize = TRIM( Request("recs") )
If pagesize = "" Then pagesize = 9

sqlString = " *********** Query ************** "
conString=" ********* Database Connection ********** "

Set theConnection = Server.CreateObject("ADODB.Connection")
Set prodRS = Server.CreateObject("ADODB.Recordset")

prodRS.CursorLocation = 3
prodRS.CursorType = 3

theConnection.Open conString
prodRS.Open sqlString,theConnection

prodRS.PageSize = pagesize
prodRS.AbsolutePage = pg
numpages = prodRS.PageCount
numrecs = prodRS.RecordCount

%>

<html>
<body>

<%
Response.Write("" & numrecs & " records found." )
%>

<BR>

<FORM NAME="myform" METHOD="post" ACTION="results.asp">
Display
<SELECT NAME="recs">
<OPTION VALUE=1> 1
<OPTION VALUE=2> 2
<OPTION VALUE=3> 3
<OPTION VALUE=4> 4
<OPTION VALUE=5> 5
<OPTION VALUE=6> 6
<OPTION VALUE=7> 7
<OPTION VALUE=8> 8
<OPTION VALUE=9> 9
<OPTION VALUE=10> 10
</SELECT>
images per page
<INPUT TYPE=submit VALUE="GO">
</FORM>

<BR>
<%
IF numpages > 1 THEN
%>
<font color="black" face="Univers">Page: </font>
<font color="#811788" face="Univers">
<%=pg %> of <%=numpages %>
</font>

<BR>
<%
dim i
FOR i = 1 to numpages
IF i <> cINT( pg ) THEN
%>
<a href="results.asp?pg=<%=i%>">
<%=i%></a>&nbsp;
<% ELSE %>
<b><%=i%></b>&nbsp;
<% END IF %>
<% NEXT %>
<% END IF
%>

<BR>
<% IF pg = 1 THEN %>
&nbsp;
<% ELSE %>
<% j = pg - 1 %>
<a href="results.asp?pg=<%=j%>"><img src="leftarrow.jpg" border="0"></a>
<% j = pg %>
<% END IF %>
<% IF (pg) = (numpages) THEN %>
&nbsp;
<% ELSE %>
<% dim j %>
<% j = pg + 1 %>
<a href="results.asp?pg=<%=j%>"><img src="rightarrow.jpg" border="0"></a>
<% j = pg %>
<% END IF %>
<BR>
<%
dim m
FOR m = 1 to pagesize
%>
Ref#<%=prodRS( "image_id" )%>
<%prodRS.movenext%>
<% NEXT %>
</body>
</html>

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseSQL Development > Recordset Problem with Absolutepage and adOpenStatic PLEASE 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


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





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT