473,394 Members | 1,640 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,394 software developers and data experts.

Moving to next recordset

347 100+
Hi everyone

i am trying to make a page that goes to the next recorset when i click on a button so the page only shows one record at a time, this is for updating so i need to be able to go to the next recodset from the page that updates the database also.

the code for the page that i have which lists all the records is as follows

Expand|Select|Wrap|Line Numbers
  1. <%@LANGUAGE=VBSCRIPT%>
  2. <%voiceid=Request.Querystring("id")%>
  3. <%
  4. Response.Expires=0
  5. Set YaketyConnection=Server.CreateObject("ADODB.Connection")
  6. DatabaseDetails="DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.Mappath("database.mdb") & ";"
  7. YaketyConnection.Open DatabaseDetails
  8. YaketyQuery="SELECT * FROM mp3 INNER JOIN celebs ON mp3.celebid = celebs.idnumber WHERE mp3.celebid = "&voiceid&""
  9. Set YaketyRecordset=YaketyConnection.execute(YaketyQuery)
  10. %>
  11.  
  12.  
  13.  
  14. <HTML>
  15. <HEAD>
  16.  
  17. <TITLE>Update Record</TITLE>
  18.  
  19.  
  20. <SCRIPT language="javascript" src="admincheck.js"></SCRIPT>
  21.  
  22. <SCRIPT src="../../Scripts/AC_RunActiveContent.js" type="text/javascript"></SCRIPT>
  23. </HEAD>
  24. <BODY>
  25. <BR>
  26.  
  27. <TABLE width="90%" border="1" align="center">
  28.                         <%
  29. Do Until(yaketyRecordset.EOF)
  30. %>
  31. <%
  32. If Not yaketyRecordset.EOF Then %>
  33.   <TR> 
  34.     <TD valign="top">
  35.       <FORM action="updateok.asp" method="post">
  36.         <P align="center"><SPAN class="headertextCopy">UPDATE RECORD</SPAN><SPAN><BR>
  37.           <BR>
  38.           <FONT color="#FF0000">DO NOT USE ANY PUNCTATION</FONT></SPAN></P>
  39.         <TABLE width="100%" border="0" cellspacing="0" cellpadding="0" bordercolor="#CCFFFF" class="background">
  40.           <TR>
  41.             <TD class="admintext" align="right">filename</TD>
  42.             <TD colspan="2" align="left" class="admintext"><INPUT name="filename" type="text" id="filename" value="<%=YaketyRecordset("filename")%>" size="100"></TD>
  43.           </TR>
  44.           <TR> 
  45.             <TD class="admintext" width="25%" align="right"><P>&nbsp;</P>            </TD>
  46.             <TD colspan="2" align="left" class="admintext"><SCRIPT type="text/javascript">
  47. AC_FL_RunContent( 'data','../pages/player_mp3.swf','type','application/x-shockwave-flash','width','50','height','20','movie','../pages/player_mp3','bgcolor','#ef007b','flashvars','mp3=../search/<%=yaketyRecordset("surname")%>/<%=yaketyRecordset("filename")%>.mp3&showvolume=0&showslider=0&showstop=1&width=50&bgcolor1=ef007b&bgcolor2=ef007b&buttonovercolor=000000' ); //end AC code
  48.                                     </SCRIPT>
  49.                 <NOSCRIPT>
  50.                 <OBJECT data="../pages/player_mp3.swf" type="application/x-shockwave-flash" width="50" height="20">
  51.                   <PARAM name="movie" value="../pages/player_mp3.swf" />
  52.                   <PARAM name="bgcolor" value="#ef007b" />
  53.                   <PARAM name="FlashVars" value="mp3=../search/<%=yaketyRecordset("surname")%>/<%=yaketyRecordset("filename")%>.mp3&amp;showvolume=0&amp;showslider=0&amp;showstop=1&amp;width=50&amp;bgcolor1=ef007b&amp;bgcolor2=ef007b&amp;buttonovercolor=000000" />
  54.                 </OBJECT>
  55.             </NOSCRIPT></TD>
  56.           </TR>
  57.           <TR> 
  58.             <TD class="admintext" width="25%" align="right">search terms</TD>
  59.             <TD class="admintext" width="25%" align="left"> 
  60.               <TEXTAREA name="new_information" cols="100" rows="5"><%=YaketyRecordset("mp3type")%></TEXTAREA>            </TD>
  61.           </TR>
  62.         </TABLE>
  63.         <DIV align="center"> 
  64.         <INPUT name="id_number" type="text" value="<%=YaketyRecordset("idnumbermp3")%>">
  65.         <BR>
  66.           <INPUT type="submit" name="Submit" value="Submit">
  67.           <INPUT type="button" name="reset" value="Reset">
  68.         </DIV>
  69.       </FORM>
  70.  
  71.     </TD>
  72.   </TR>
  73. <%  yaketyRecordset.MoveNext
  74. End If
  75. %>
  76.                         <%
  77. Loop
  78.  
  79. %>
  80. </TABLE>
  81. <BR>      <% 
  82. YaketyRecordset.Close
  83. YaketyConnection.Close
  84. %>
  85. </BODY>
Jul 23 '09 #1
1 3858
GazMathias
228 Expert 128KB
Hi,

If your table has a unique incremented ID field you could simply track which record you are on via a session variable and simply call that ID + 1 in the query.

Obviously, the recordset would only include the one record.

Gaz
Jul 24 '09 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: RT | last post by:
Hello; I'm trying to create a updates pages that I can move either to the previous record or the next record within a recordset without having to return to the repeating list of records after...
4
by: hinrich | last post by:
Hello, I have a completely new system (windows xp prof.), office xp 2002 with sp 3. When I create a new and empty Accesss database, create an empty table and then create a new form using a...
3
by: scottallenmccullough | last post by:
I'm sure there is an easy solution for this problem. On "FORM A" is a combobox with a separate table as its record source. If the data required in the combobox is not one of the available choices...
4
by: sexy_shot | last post by:
hello friends i am devloping an application using ms-access database. I want to move next on the recordset.Please send me solution with source code. i am in hurry please send as...
11
by: scsTiger | last post by:
I am using Access 2000 as the front end and MS SQL 2000 as the backend. I have a one record form that I set using something like: strSQL = "SELECT * FROM dbo_WBACCT WHERE...
1
by: maiami2 | last post by:
Hi Guys, I'm very new to access and I've been trying to get the hang of it over the last few days, but I've become very confused with various aspects of how to code it. Introduction: I am...
1
by: Shaolin | last post by:
Hi guys I;m trying to move all my Listview content into a module because I have to call it several times and it becomes annoying having to type it a number of times. I'm a little stuck though....
0
by: SuzK | last post by:
I am trying to calculate in VBA in Access 2002 a moving average and update a table with the calculations. Fields in my WeeklyData table are Week Ending (date) ItemNbr (double) Sales Dollars...
15
by: mcjason | last post by:
I saw something interesting about a grid pair puzzle problem that it looks like a machine when you find each that work out the way it does and say with all the others that work out the way they...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.