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.CreateOb ject("ADODB.Con nection")
adoDataConn.Ope n 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.Exe cute(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 5 2338
David wrote on 24 apr 2007 in microsoft.publi c.inetserver.as p.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.CreateOb ject("ADODB.Con nection")
adoDataConn.Ope n 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.Exe cute(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.queryst ing("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)
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.queryst ing("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)
David wrote on 24 apr 2007 in microsoft.publi c.inetserver.as p.general:
>[If the ReportID is continuous from 0]
n = request.queryst ing("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)
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)
David wrote on 24 apr 2007 in microsoft.publi c.inetserver.as p.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) This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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 http://Asp.ForumsZone.com
|
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 stuck here.
|
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 the second page will
always all records number minus pagesize. for example, if I have total
5 records and pagesize = 2, then first page will show 5 record and
second one will show 3 and the last page will show the last one.
any one have some...
|
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 nicely, including the paging. I have now
changed the query to select from two joined tables and
suddenly it tells me that my recordset does not support
paging. Why is this?
Any help would be much appreciated,
|
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 to win2003 using SQL 2003
I get the above error when my asp page does teh line:
Rs.absolutepage = intCurrentPage
I tested teh value of intCurrent page and teh value is 1.
| |
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 more pages and having
100 or more page links is ugly, to say the least. Below is the code
that I am using for the paging. I'd like something like pages 1 - 5,
click 5 or next, then pages 6-10 are displayed, etc. I am not sure where
to start as...
|
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, I get the
following error:
ADODB.Field error '800a0bcd'
Either BOF or EOF is True, or the current record has been deleted. Requested
operation requires a current record.
|
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 results page.
- Recordset Paging works if no parameters are used in the recordset sql code (ie. simple sql code):
SELECT *
FROM db_name
WHERE (db_field1 LIKE ‘%text1%’ OR db_field2 LIKE ‘%text2%’)
|
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,
they have the same code, but only one asp works,
when I try to open the second page i got this error:
Error Type:
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
| |
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |