Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 5th, 2008, 02:28 AM
Registered User
 
Join Date: Jan 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default rs.MoveNext loops the page

Ok, i am very unfamiliar with ASP but the problem i am having is that the page loops itself. I.E. it goes from header to footer and then loops another 10 times. I believe it is "because of rs.movenext" or "because the OPEN DB CONN is inside the page loop". PLEASE help if you see anything that is a simple fix.


<%
email= Session("Email")

' OPEN DATABASE CONNECTION
Set Conn = Server.CreateObject("ADODB.Connection")
conn.open "PROVIDER=SQLOLEDB;DATA SOURCE=sql2.reinventinc.com;UID=re9165;PWD=sys709; DATABASE=jobspath"


' Open Recordset
Set RS = Server.CreateObject( "ADODB.Recordset" )
RS.CursorType = adOpenStatic

mySQL= "SELECT * FROM jregister where email = '" & email & "'"
RS.Open mySQL, Conn


while NOT rs.eof
%>

<html>
<head>
<title>JOBSPATH.COM</TITLE>
<meta name="Author" content="Jobspath" />
<meta name="GENERATOR" content="Jobspath" />
<meta name="TITLE" value="Jobspath.com"/>
<meta name="alias" content="http://www.jobspath.com/">
<meta name="DESCRIPTION" content="The Jobspath.com web page, entry point to information about Jobspath.com products and services"/>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head>
<link href="style.css" rel="stylesheet" type="text/css">
<body link="#FFFFFF" vlink="#FFFFFF" alink="#FFFFFF" MARGINHEIGHT="0" MARGINWIDTH="0" LEFTMARGIN="0" TOPMARGIN="0">

<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td valign="top">



      <div align="center">
    <table class="table_body">
                   <tr>
        <td id="center_columnreg" align="center">
            <div class="mod_title">Resume Update</div>
            <div id="update_resume">
            <div class="mod_textbox1">
                <form name="form1" method="post" action="jregister1.asp">

                <br />


                     First name

                          <input name="rfname" type="text" id="rfname" value="<%=RS( "rfname" )%>" size="25" class="name">
                          &nbsp;
                       Last name

                          <input name="rlname" type="text" id="rlname" value="<%=RS( "rlname" )%>" size="25" class="last">

                     <br />
                     E-mail

                          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input name="email" type="text" id="email" value="<%=RS( "email" )%>" size="25" class="email">

                        &nbsp;&nbsp;&nbsp;&nbsp;Password

                          <input name="password" type="text" id="password" size="25" class="password">
                          <br /><br />Address

                         &nbsp;&nbsp;&nbsp;<input name="address" type="text" id="address" value="<%=RS( "address" )%>" size="70" class="address">
                          &nbsp;
                    <br />City

                           &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ; <input name="city" type="text" id="city" value="<%=RS( "city" )%>" size="25" class="city">

                        &nbsp;State
                          <input name="state" type="text" id="state" value="<%=RS( "state" )%>" size="19" class="state">
                          &nbsp;ZIP
                          <input name="zip" type="text" id="zip" value="<%=RS( "zip" )%>" size="3" class="zip">
                           <br /><br />Phone

                         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input name="hphone" type="text" id="hphone" value="<%=RS( "hphone" )%>" size="25" class="homephone">

                        Work Phone

                          <input name="wphone" type="text" id="wphone" value="<%=RS( "wphone" )%>" size="25" class="workphone">
                          <br />


                        &nbsp;
                        &nbsp;<br />
                      Visa Status
                         <br />
                          <INPUT NAME="visa" class="textbox" TYPE=RADIO value="Yes, I am a U.S. citizen or Green Card holder.">
                          Yes, I am a U.S. citizen/Green Card holder.<br>
                          <INPUT NAME="visa" class="textbox" TYPE=RADIO value="Yes, I have a permit to work in the U.S.">
                          Yes, I have a permit to work in the U.S.<br>
                          <INPUT NAME="visa" class="textbox" TYPE=RADIO value="No, I require sponsorship to work in the U.S.">
                          No, I require sponsorship to work in the U.S. <br /><br />

                        Available to start

                          &nbsp;&nbsp;<input name="available" type="text" value="<%=RS( "available" )%>" id="available" size="25" class="avaib_start">
                          <br/>


                        Main Job Category



                          <textarea name="objective" cols="51" rows="3" wrap="VIRTUAL" id="objective" class="objective">value="<%=RS( "objective" )%>"</textarea>

                        Objective

                          <textarea name="workexp" cols="51" rows="5" wrap="VIRTUAL" id="workexp" class="workexp">value="<%=RS( "workexp" )%>"</textarea>

                     Work Experience

                          <textarea name="education" cols="51" rows="5" wrap="VIRTUAL" id="education" class="educatoin">value="<%=RS( "education" )%>"</textarea>

                      Education

                          <textarea name="other" cols="51" rows="5" wrap="VIRTUAL" id="other" class="other">value="<%=RS( "other" )%>"</textarea>

                      Other
                    <br><br />

                          Preferred work locations

                          <input name="rjpwa" type="text" id="rjpwa" value="<%=RS( "rjpwa" )%>" size="25" class="pref_loc">

                                          how to contact

                          <input name="contact" type="text" id="contact" size="20" class="to_contact">

                    <div align="center">

                      <input type="submit" name="Submit" value="Update" class="jregister_submit">
                      <input type="reset" name="Submit2" value="Clear" class="jobseek_submit">
                    </div>
                  </form>
</div>
</div>
   </td>
   </tr>
    </table>
     </div>
      </td>
      </tr>
      <td></td>
      </table>
</body>
</html>
<%
rs.movenext1
wend

RS.Close
Conn.Close
Set Conn = Nothing
%>
 
Old January 8th, 2008, 12:44 PM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 599
Thanks: 6
Thanked 3 Times in 3 Posts
Default

You have the whole page within the loop! Its going to loop as many times as there are records for your SQL query. If you only want one record then you don't really need a loop. You just need to make sure that your query only pulls one record.



 
Old January 14th, 2008, 01:03 PM
Registered User
 
Join Date: Jan 2008
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Raajagopal.v Send a message via MSN to Raajagopal.v Send a message via Yahoo to Raajagopal.v
Default

hi!
i dont know why you want a loop statement in this page as it is not necessary and if you still want the loop statement let me know where you want it?

at your service
-v.raajagopal





Similar Threads
Thread Thread Starter Forum Replies Last Post
break for-each loops, or limit amount of loops warhero XSLT 2 July 4th, 2007 02:18 AM
rs.movenext problem hastikeyvan Dreamweaver (all versions) 1 October 27th, 2005 10:13 AM
While loops and For loops in XSLT spencer.clark XSLT 1 August 5th, 2005 09:50 AM
RS Manager and RS Server on 2 different computers Choose File BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 1 July 22nd, 2004 10:56 AM
Error msg on rs.MoveNext jeff_M Classic ASP Databases 4 August 13th, 2003 10:38 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.