473,396 Members | 1,886 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Recordset paging headache .....

Hi,

I have always wanted to get the following working, but have never yet
mastered it :-(

I have an asp page which displays a list of records depending on what
was selected via another form.
I want to have these results broken down, displaying only 10 records,
with links underneath to display as
'Previous' and 'Next'

__________________________________________________ ___________

Firstly I have an include file for the connection which is:

strConnection = "xxxxxxxxxx"
Set adoDataConn = Server.CreateObject("ADODB.Connection")
adoDataConn.Open strConnection

__________________________________________________ ____________

On my actual asp page, I just run the following code and print the
results on the screen

strquery = "SELECT * FROM reports ORDER BY ReportID DESC;"
Set RS = adoDataConn.Execute(strquery)

If RS.EOF then
Scream
Else
Print Results
End If
__________________________________________________ ____________

What do I need to do to get this paging working. I have looked at many
example, but keep running into problems with bookmarks and recordset
not supporting this and that.

I would really appreciate any help in geting this working.

Thanks in advance

David

Apr 24 '07 #1
5 2322
David wrote on 24 apr 2007 in microsoft.public.inetserver.asp.general:
Hi,

I have always wanted to get the following working, but have never yet
mastered it :-(

I have an asp page which displays a list of records depending on what
was selected via another form.
I want to have these results broken down, displaying only 10 records,
with links underneath to display as
'Previous' and 'Next'

__________________________________________________ ___________

Firstly I have an include file for the connection which is:

strConnection = "xxxxxxxxxx"
Set adoDataConn = Server.CreateObject("ADODB.Connection")
adoDataConn.Open strConnection

__________________________________________________ ____________

On my actual asp page, I just run the following code and print the
results on the screen

strquery = "SELECT * FROM reports ORDER BY ReportID DESC;"
Set RS = adoDataConn.Execute(strquery)

If RS.EOF then
Scream
Else
Print Results
End If
__________________________________________________ ____________

What do I need to do to get this paging working. I have looked at many
example, but keep running into problems with bookmarks and recordset
not supporting this and that.

I would really appreciate any help in geting this working.
[If the ReportID is continuous from 0]

n = request.querysting("n")
if n="" or n<0 or not IsNumeric(n) then n=0

sql = "SELECT TOP 10 * FROM reports Where ReportID "&n&"
ORDER BY ReportID;"
<a href='thisfile.asp?n=<% = n-10 %>'>Previous 10</a>
<a href='thisfile.asp?n=<% = n+10 %>'>Next 10</a>
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Apr 24 '07 #2
Thanks Evertjan,

I get this error:-

Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

[MySQL][ODBC 3.51 Driver][mysqld-4.0.20a-max]You have an error in your
SQL syntax. Check the manual that corresponds to your MySQL server
version for the right syntax to use near '10 * FROM reports Where
ReportID >0 ORDER BY ReportID DESC' at

/Repair_Reports/preview_all.asp, line 85

___________________________________________

I have coded:
strquery = "SELECT TOP 10 * FROM reports Where ReportID >" & n & "
ORDER BY ReportID DESC;"

-----------------------------------------------------------------------------------------------------

>
[If the ReportID is continuous from 0]

n = request.querysting("n")
if n="" or n<0 or not IsNumeric(n) then n=0

sql = "SELECT TOP 10 * FROM reports Where ReportID "&n&"
ORDER BY ReportID;"

<a href='thisfile.asp?n=<% = n-10 %>'>Previous 10</a>
<a href='thisfile.asp?n=<% = n+10 %>'>Next 10</a>

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Apr 24 '07 #3
David wrote on 24 apr 2007 in microsoft.public.inetserver.asp.general:
>[If the ReportID is continuous from 0]

n = request.querysting("n")
if n="" or n<0 or not IsNumeric(n) then n=0

sql = "SELECT TOP 10 * FROM reports Where ReportID "&n&"
ORDER BY ReportID;"

<a href='thisfile.asp?n=<% = n-10 %>'>Previous 10</a>
<a href='thisfile.asp?n=<% = n+10 %>'>Next 10</a>
[Please do not toppost on usenet]
[Please do not include signatures in quotes on usenet]
I get this error:-
[MySQL][ODBC 3.51 Driver][mysqld-4.0.20a-max]You have an error in your
SQL syntax. Check the manual that corresponds to your MySQL server
version for the right syntax to use near '10 * FROM reports Where
ReportID >0 ORDER BY ReportID DESC' at
I have coded:
strquery = "SELECT TOP 10 * FROM reports Where ReportID >" & n & "
ORDER BY ReportID DESC;"
Not that it explains the error, but the DESC is illogical with
Where ReportID >" & n & "

Is ReportID a numeric field ?

Or it could be that top is not allowed with * in MySQL,
I never used mySQL under ASP.

Please report the litteral SQL result resulting from this::

strquery = "SELECT TOP 10 * FROM reports Where ReportID >" & n & "
ORDER BY ReportID DESC;"
response.write strquery
response.end

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Apr 24 '07 #4
Evertjan,

your code prints:
SELECT TOP 10 * FROM reports Where ReportID >0 ORDER BY ReportID DESC;
>>ReportID is the TableID field (Numeric)
------------------------------------------------------------------------------------------------------
>
Not that it explains the error, but the DESC is illogical with
Where ReportID >" & n & "

Is ReportID a numeric field ?

Or it could be that top is not allowed with * in MySQL,
I never used mySQL under ASP.

Please report the litteral SQL result resulting from this::

strquery = "SELECT TOP 10 * FROM reports Where ReportID >" & n & "
ORDER BY ReportID DESC;"
response.write strquery
response.end

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Apr 24 '07 #5
David wrote on 24 apr 2007 in microsoft.public.inetserver.asp.general:
Evertjan,

your code prints:
Sorry, I do not like topposting on usenet.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Apr 24 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Dima | last post by:
Does anybody know where can i get a sample on how to do recordset paging between two frames or between page an iframe that is within. ----------------------------- This message is posted by...
5
by: Bruno Alexandre | last post by:
Hi guys, withou using SP, I want to be able to add a Parameter to the SQL Query and retrive the Recordset so I can use the Paging property under the recorset object.... how can I do this? I'm...
1
by: Li | last post by:
Hi, guys, I got a problem when trying to paging the recordset. the problem is even I set the pagesize but the first page will always show all the records and the number of records that shown on...
3
by: sara | last post by:
Hi all, I have a strange problem. I have a page where I am creating a recordset that can handle paging and the query for it was originally selecting from only one table. This was all working...
9
by: Johnfli | last post by:
ADODB.Recordset error '800a0cb3' Current Recordset does not support bookmarks. This may be a limitation of the provider or of the selected cursortype. I am moving my webserver from NT4 using SQL...
2
by: Jeff Gardner | last post by:
Greetings: I've a script written for paging through a given recordset with page links, etc. I want to be able to limit the number of page numbers displayed as a large query may result in 100 or...
2
by: Simon Harris | last post by:
Hi All, As you may have seen from my earlier post, I am trying to setup paging on an ASP application, I *think* this is 99% there. The only problem I have left, is when I get to the last page,...
2
by: wallconor | last post by:
Hi, I am having a problem using Dreamweaver CS3 standard recordset paging behavior. It doesn’t seem to work when I pass parameter values from a FORM on my search page, to the recordset on my...
6
by: Yosi | last post by:
Hi all, I have access database file with 2 tables, the tables have the same columns but with different data, and I have 2 asp files that show the content of each table with paging recordset,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.