User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 397,706 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,341 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting

how to get to next record on click of a button.

Join Date: Mar 2007
Posts: 83
Reputation: rgtaylor is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 2
rgtaylor rgtaylor is offline Offline
Junior Poster in Training

Re: how to get to next record on click of a button.

  #4  
Mar 23rd, 2007
Hey, if you are using Java/JSP and/or servlets you can always save your rs object in the session, which would make it remain accross browser transactions...BUT I have never tried it that way...

I also NEVER work with MS Access unless it is on my desktop...it is just not a good choice even for learning...despite what the book might have told you... PostgreSQL or MySQL are free and VERY simple to download and install/setup if you follow the instructions, in the old days they were more difficult, but today they are a breeze... use them...

I have Apache Web Server, Apache Tomcat and PostgreSQL installed on my Windows XP laptop and use them for dev testing and POC (proof of concept) creation all the time...it is a better learning environment, so I suggest you invest 2 hours and set them all up...they can all be done in 2 hours total or less usually...

You should have an "order by" in your SQL to ensure the order is always the same... then use a limit and offset to depending on the DB support, some accept "limit 10, 20" for ten at a time starting from record #20... others use 2 separate keywords "limit 10 offset 20" ... once you know which way works for you DB, you can set limit 1 and offset iNum where "iNum" is the record number to show...

you set input field in the page to have the current value (or next value) and use those to figure out what the offset should be next time around...

i.e.
<code>


<input type="hidden" name="next" value="<%=iNum%>">

</code>

you could extend this then to provide forward and back or even jump capability for your records, but you would be reselecting the record each time, so you must be sure they are properly ordered with the "order by" keywords
Reply With Quote  
All times are GMT -4. The time now is 1:48 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC