Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to do this?
Message
General information
Forum:
Internet
Category:
Active Server Page
Title:
Miscellaneous
Thread ID:
00564820
Message ID:
00564864
Views:
16
Hi Ahmad,

When you build the page's HTML code, for the Next and Previous buttons generate anchors that contain the current record's key and point to NextRec.asp and PrevRec.asp, respectively:

Next record
Previous record

Then, in the two ASPs, find the correct record and build the same page layout. The only difference between NextRec.asp and PrevRec.asp will be the SQL code.

In NextRec.asp, use

CurrRecKey = Request("CurrRecKey")
Cmd = "SELECT TOP 1 * FROM RecTable WHERE ID >" & CurrRecKey & " ORDER BY ID"

In PrevRec.asp use ORDER BY ID DESC"

CurrRecKey = Request("CurrRecKey")
Cmd = "SELECT TOP 1 * FROM RecTable WHERE ID <" & CurrRecKey & " ORDER BY ID DESC"


This assumes you're using SQL 7.0 or Oracle. Be careful about the use of "<" and ">".

Les
Les Pinter
(650) 344-3969
Les@LesPinter.com for consulting bookings.
www.LesPinter.com.

Watch for my forthcoming book on "Developing Database Applications in VFP and VB.NET".
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform