Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to do this?
Message
Information générale
Forum:
Internet
Catégorie:
Active Server Page
Titre:
Divers
Thread ID:
00564820
Message ID:
00564864
Vues:
17
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".
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform