while loop

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • idsanjeev
    New Member
    • Oct 2007
    • 241

    while loop

    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.


    [CODE=asp]
    Prn = VAR_TYPE

    Set R= CON.EXECUTE("SE LECT item_type,color FROM printer_master WHERE Prn_Sl_No IN(SELECT Prn_sl_No FROM PRINTER_ISSUED WHERE Prn_Is_No='"&Pr n&"')")

    while not R.EOF
    if R("color")=var_ clr then
    VAR_CLR =R("color")
    else
    response.Redire ct("massage.asp ")
    R.MoveNext
    End if
    wend


    Set CT = CON.EXECUTE("SE LECT 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&" ' ")
    VAR_TYPE = CT("Item_type" )[/CODE]
  • shweta123
    Recognized Expert Contributor
    • Nov 2006
    • 692

    #2
    Hi,

    Are you getting any error into this?


    Originally posted by idsanjeev
    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.


    [CODE=asp]
    Prn = VAR_TYPE

    Set R= CON.EXECUTE("SE LECT item_type,color FROM printer_master WHERE Prn_Sl_No IN(SELECT Prn_sl_No FROM PRINTER_ISSUED WHERE Prn_Is_No='"&Pr n&"')")

    while not R.EOF
    if R("color")=var_ clr then
    VAR_CLR =R("color")
    else
    response.Redire ct("massage.asp ")
    R.MoveNext
    End if
    wend


    Set CT = CON.EXECUTE("SE LECT 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&" ' ")
    VAR_TYPE = CT("Item_type" )[/CODE]

    Comment

    • idsanjeev
      New Member
      • Oct 2007
      • 241

      #3
      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.ScriptTi meout or by changing the value in the IIS administration tools.

      Comment

      • idsanjeev
        New Member
        • Oct 2007
        • 241

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

        Comment

        • shweta123
          Recognized Expert Contributor
          • Nov 2006
          • 692

          #5
          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.Redire ct("massage.asp ")
          End if
          R.MoveNext
          wend

          Originally posted by idsanjeev
          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

          Comment

          Working...