Moving to next recordset

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • colinod
    Contributor
    • Nov 2007
    • 347

    Moving to next recordset

    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

    Code:
    <%@LANGUAGE=VBSCRIPT%>
    <%voiceid=Request.Querystring("id")%>
    <%
    Response.Expires=0
    Set YaketyConnection=Server.CreateObject("ADODB.Connection")
    DatabaseDetails="DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.Mappath("database.mdb") & ";"
    YaketyConnection.Open DatabaseDetails
    YaketyQuery="SELECT * FROM mp3 INNER JOIN celebs ON mp3.celebid = celebs.idnumber WHERE mp3.celebid = "&voiceid&""
    Set YaketyRecordset=YaketyConnection.execute(YaketyQuery)
    %>
    
    
    
    <HTML>
    <HEAD>
    
    <TITLE>Update Record</TITLE>
    
    
    <SCRIPT language="javascript" src="admincheck.js"></SCRIPT>
    
    <SCRIPT src="../../Scripts/AC_RunActiveContent.js" type="text/javascript"></SCRIPT>
    </HEAD>
    <BODY>
    <BR>
    
    <TABLE width="90%" border="1" align="center">
                            <%
    Do Until(yaketyRecordset.EOF)
    %>
    <%
    If Not yaketyRecordset.EOF Then %>
      <TR> 
        <TD valign="top">
          <FORM action="updateok.asp" method="post">
            <P align="center"><SPAN class="headertextCopy">UPDATE RECORD</SPAN><SPAN><BR>
              <BR>
              <FONT color="#FF0000">DO NOT USE ANY PUNCTATION</FONT></SPAN></P>
            <TABLE width="100%" border="0" cellspacing="0" cellpadding="0" bordercolor="#CCFFFF" class="background">
              <TR>
                <TD class="admintext" align="right">filename</TD>
                <TD colspan="2" align="left" class="admintext"><INPUT name="filename" type="text" id="filename" value="<%=YaketyRecordset("filename")%>" size="100"></TD>
              </TR>
              <TR> 
                <TD class="admintext" width="25%" align="right"><P>&nbsp;</P>            </TD>
                <TD colspan="2" align="left" class="admintext"><SCRIPT type="text/javascript">
    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
                                        </SCRIPT>
                    <NOSCRIPT>
                    <OBJECT data="../pages/player_mp3.swf" type="application/x-shockwave-flash" width="50" height="20">
                      <PARAM name="movie" value="../pages/player_mp3.swf" />
                      <PARAM name="bgcolor" value="#ef007b" />
                      <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" />
                    </OBJECT>
                </NOSCRIPT></TD>
              </TR>
              <TR> 
                <TD class="admintext" width="25%" align="right">search terms</TD>
                <TD class="admintext" width="25%" align="left"> 
                  <TEXTAREA name="new_information" cols="100" rows="5"><%=YaketyRecordset("mp3type")%></TEXTAREA>            </TD>
              </TR>
            </TABLE>
            <DIV align="center"> 
    		<INPUT name="id_number" type="text" value="<%=YaketyRecordset("idnumbermp3")%>">
    		<BR>
              <INPUT type="submit" name="Submit" value="Submit">
              <INPUT type="button" name="reset" value="Reset">
            </DIV>
          </FORM>
    
        </TD>
      </TR>
    <%  yaketyRecordset.MoveNext
    End If
    %>
                            <%
    Loop
    
    %>
    </TABLE>
    <BR>      <% 
    YaketyRecordset.Close
    YaketyConnection.Close
    %>
    </BODY>
  • GazMathias
    Recognized Expert New Member
    • Oct 2008
    • 228

    #2
    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

    Comment

    Working...