473,394 Members | 1,759 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.

while loop

idsanjeev
241 100+
hello
i am using it for diaplay massage if selected cartidge color is not color the massage oherwise work when remove the while loop it accept first color of that cartidge.


Expand|Select|Wrap|Line Numbers
  1. Prn = VAR_TYPE
  2.  
  3. Set R= CON.EXECUTE("SELECT item_type,color FROM printer_master WHERE Prn_Sl_No IN(SELECT Prn_sl_No FROM PRINTER_ISSUED WHERE Prn_Is_No='"&Prn&"')")
  4.  
  5. while not R.EOF
  6. if R("color")=var_clr then
  7. VAR_CLR    =R("color")
  8. else
  9. response.Redirect("massage.asp")
  10. R.MoveNext
  11. End if
  12. wend
  13.  
  14.  
  15. Set CT = CON.EXECUTE("SELECT item_type FROM printer_master WHERE Prn_Sl_No IN (SELECT Prn_Sl_No FROM PRINTER_ISSUED WHERE Prn_IS_No ='"&Prn&"' ) AND COLOR= '"&VAR_CLR&"' ")
  16.  VAR_TYPE = CT("Item_type")
Jan 24 '08 #1
4 1825
shweta123
692 Expert 512MB
Hi,

Are you getting any error into this?


hello
i am using it for diaplay massage if selected cartidge color is not color the massage oherwise work when remove the while loop it accept first color of that cartidge.


Expand|Select|Wrap|Line Numbers
  1. Prn = VAR_TYPE
  2.  
  3. Set R= CON.EXECUTE("SELECT item_type,color FROM printer_master WHERE Prn_Sl_No IN(SELECT Prn_sl_No FROM PRINTER_ISSUED WHERE Prn_Is_No='"&Prn&"')")
  4.  
  5. while not R.EOF
  6. if R("color")=var_clr then
  7. VAR_CLR    =R("color")
  8. else
  9. response.Redirect("massage.asp")
  10. R.MoveNext
  11. End if
  12. wend
  13.  
  14.  
  15. Set CT = CON.EXECUTE("SELECT item_type FROM printer_master WHERE Prn_Sl_No IN (SELECT Prn_Sl_No FROM PRINTER_ISSUED WHERE Prn_IS_No ='"&Prn&"' ) AND COLOR= '"&VAR_CLR&"' ")
  16.  VAR_TYPE = CT("Item_type")
Jan 24 '08 #2
idsanjeev
241 100+
ya
Error Type:
Active Server Pages, ASP 0113 (0x80004005)
The maximum amount of time for a script to execute was exceeded. You can change this limit by specifying a new value for the property Server.ScriptTimeout or by changing the value in the IIS administration tools.
Jan 24 '08 #3
idsanjeev
241 100+
I wants to do is printer cartige type is slected and the color of cartidge is selected then
chek if color of cartidge match then insert data into table ohtewise error massage
Jan 24 '08 #4
shweta123
692 Expert 512MB
Hi,

I think you are getting error because you have put R.moveNext statement into else part. Put it after end if.

e.g.

while not R.EOF
if R("color")=var_clr then
VAR_CLR =R("color")
else
response.Redirect("massage.asp")
End if
R.MoveNext
wend

I wants to do is printer cartige type is slected and the color of cartidge is selected then
chek if color of cartidge match then insert data into table ohtewise error massage
Jan 24 '08 #5

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

Similar topics

14
by: jsaul | last post by:
Hi there, wouldn't it be useful to have a 'while' conditional in addition to 'if' in list comprehensions? foo = for i in bar: if len(i) == 0: break foo.append(i)
33
by: Diez B. Roggisch | last post by:
Hi, today I rummaged through the language spec to see whats in the for ... else: for me. I was sort of disappointed to learn that the else clauses simply gets executed after the loop-body -...
9
by: Ben | last post by:
I have two 'Do While Not' statements, that are getting information from the same recordset. If I comment out the first one I can get the results for the second one, and vice-versa. Why is this...
7
by: Mahesh Kumar Reddy.R | last post by:
Hi Can any body resolve this.. In what cases one of the loop constructs better than other interms of speed , space and any other (redability). thanks mahesh
36
by: invni | last post by:
I have a nested while. How do I go from the inner while to the beginning of the outer while? Can this be done without using goto? while_1() { some codes here while_2() { if true go to the...
6
by: John Pass | last post by:
What is the difference between a While and Do While/Loop repetition structure. If they is no difference (as it seems) why do both exist?
12
by: Howard | last post by:
Hello everyone (total VB.NET beginner here), I'm reading the "SAMS Teach Yourself VB.NET In 21 Days" book, and came across an exercise that I can't get to work. The exercise asks that you create...
16
by: Claudio Grondi | last post by:
Sometimes it is known in advance, that the time spent in a loop will be in order of minutes or even hours, so it makes sense to optimize each element in the loop to make it run faster. One of...
10
by: rohitjogya | last post by:
Can anyone tell me the difference bet for loop and while loop execution? ____________________ for (i=0 ; i<10 ; i++) ; /* Do nothing*/ print i; ___________________ i=0;
5
by: Alex | last post by:
Hi I just want to clear something up in my head with while loops and exceptions. I'm sure this will probably be a no brainer for most. Check this simple pseudo-code out (vb.net): ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...

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.