473,943 Members | 8,093 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Moving to next recordset

347 Contributor
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 3879
GazMathias
228 Recognized Expert New Member
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
1807
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 each up date. Assuming I have done the recordset correctly, which I have and the update records command as well here is the code I'm trying to use: <?php
4
3543
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 wizard, Access 2002 crashes when I go to the next record using the little black arrow at the bottom of the form...
3
2735
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 in the underlying recod source, the user is prompted to "click" a button opening "FORM B" allowing them to add the necessary data to the combobox's underlying recordset. Is there a way when closing FORM B and returning to FORM A to requery the...
4
8484
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 much as possiable. thanks sexy shot :)
11
3552
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 (((dbo_WBACCT.ACCOUNT)='"423456"'));" Me.RecordSource = strSQL Obviously I only want one record at a time because the database is very big.
1
1951
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 using 3 tables for my data base at the moment. The first table is an ID table, which tracks IDs that are in use/taken. The second table is a queue, which has very little/limited information on a person. The third table is a log, which has much more...
1
1543
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. I've managed to move most of the listview code onto a module but I keep getting errors. See the code below: Public Sub AddItem(lvwListView1 as listview) ConnectDB Dim lstNew As ListItem Set rs = New ADODB.Recordset rs.Open "SELECT * From...
0
4652
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 (double) Sales Units (double) Promo (Text) -- is null or "X" AvgWklyDollars (double) AvgWklyUnits (double) I have a vba module which I thought would work, but it doesn't. I think the problem is an embedded SQL Totals Top 8 query, which doesn't...
15
2484
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 do together overlapping common pieces but say connected each working out as connected, but together as connected it's connected with the others connected. a whole machine where connected together is a condition of the machine together as...
0
10143
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
11541
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
11304
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,...
0
10666
tracyyun
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...
0
9866
agi2029
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...
0
6090
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6312
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4914
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
2
4515
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.