473,408 Members | 2,734 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,408 software developers and data experts.

Simple Loop Problem

3
Hi everyone,

I am relativly new to asp and am having a problem with a loop.

This is my select statement:

Expand|Select|Wrap|Line Numbers
  1. strSql = "SELECT newsletters.*, homePage.*, pointsTable.*, pointsTable.for-pointsTable.against as gd FROM newsletters, homePage, pointsTable ORDER BY pointsTable.points DESC, pointsTable.for-pointsTable.against DESC;"
This works perfectly when the loop code is taken out, but when it is in it creates the following error:

Expand|Select|Wrap|Line Numbers
  1. ADODB.Field error '80020009' 
  2.  
  3. Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record. 
  4.  
  5. /index.asp, line 0 
I understand that it is trying to tell me there is no records in that field, but what I can't ubderstand is that if the loop is not there it works and if it is there it doesen't, frustrating!

Below is the looping code:

Expand|Select|Wrap|Line Numbers
  1. <%if NOT rscuafc.eof then
  2.   do until rscuafc.eof%>
  3.                         <tr>
  4.                           <td bgcolor="#E6E6FF"><img src="images/spacer.gif" width="1" height="2"></td>
  5. .
  6. .
  7. .
  8. .
  9. <td bgcolor="#CCCCCC"><img src="images/spacer.gif" width="1" height="1"></td>
  10. </tr>
  11. <%rscuafc.MoveNext
  12. Loop
  13. Else
  14. response.write "Sorry, there are no records."
  15. End If%>
any help would be greatly appreciated!

Thanks in advance.
Apr 9 '07 #1
4 1588
jhardman
3,406 Expert 2GB
Doesn't "do until" execute once after the condition is reached? That could cause the problem. Try "do while NOT rscuafc.eof" instead.

Let me know if this helps.

Jared
Apr 10 '07 #2
iam_clint
1,208 Expert 1GB
or while not, i don't like do's


while not rsname.eof

rsname.movenext
wend
Apr 10 '07 #3
jhardman
3,406 Expert 2GB
or while not, i don't like do's


while not rsname.eof

rsname.movenext
wend
Hey Clint, could you clarify something for me? I was under the mpression that do while ... loop was the same as while ... wend. Is there a technical difference, or is it just a matter of preference?

Jared
Apr 11 '07 #4
iam_clint
1,208 Expert 1GB
preference really there are some differences i can't think of off the top of my head.
Apr 11 '07 #5

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

Similar topics

13
by: na1paj | last post by:
here's a simple linked list program. the DeleteNode function is producing an infinit loop i think, but i can't figure out where.. #include <stdio.h> typedef struct { char *str; //str is a...
73
by: Claudio Grondi | last post by:
In the process of learning about some deeper details of Python I am curious if it is possible to write a 'prefix' code assigning to a and b something special, so, that Python gets trapped in an...
6
by: porky008 | last post by:
I need to modify the following program so that it uses a class to store and retrieve the employee's name, the hourly rate, and the number of hours worked. Use a constructor to initialize the...
9
by: Emin | last post by:
Dear Experts, I have a fairly simple query in which adding a where clause slows things down by at least a factor of 100. The following is the slow version of the query ...
0
by: rich | last post by:
Hi all, I have a fairly complex "feed" application that recieves messages from an external user-supplied API via a callback function, and attempts to forward these messages to another...
4
by: theronnightstar | last post by:
I am having a problem with a small bit of code. I can't figure out why it won't work. Here: //code: #include <iostream> #include <fstream> #include <ctype.h> #include <string>
7
by: Dustin MacDonald | last post by:
Hi everyone. This is my first time posting to this newsgroup, and although I maintain my netiquette I might've missed something specific to the newsgroup, so hopefully you can avoid flaming me...
13
by: problem. | last post by:
#include <stdio.h> #include <stdlib.h> int main(void) { int a, b; float result = 0.0f; char symbol = '\0'; int loop = 0;
30
by: galiorenye | last post by:
Hi, Given this code: A** ppA = new A*; A *pA = NULL; for(int i = 0; i < 10; ++i) { pA = ppA; //do something with pA
1
by: jerry | last post by:
i have written a simple phonebook program,i'll show you some of the codes,the program's head file is member.h . i suppose the head file works well.so i don't post it. here's the clips of main...
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...
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...
0
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...
0
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.