SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast hombre_de_las_ca's Avatar
    Join Date
    Apr 2005
    Location
    Bangalore, India
    Posts
    90
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Exclamation Shaped Data - control loop problem

    i have record set shaped as follows..
    ____
    | rs1 |------____
    |____|---> | rs2 |------____
    ................|____|--->| rs3 |-------____
    ...............................|____|---> | rs4 |
    .............................................|____|
    i.e there are chile as well as grand child recordsets..

    i have to output the contents of rs2 and in case the recordset rs2 has no value yet at all (and for that matter neither the rs3 and rs4 sub child recordsets have values in them them because they are linked by realtionships) i give "NOT FOUND"...i write the following code snippet--- but the "if" loop never gives any output...why???
    set MachX = rs1.fields("rs2").values
    if MachX.recordcount = 0 Then
    response.write "<td><font color=Blue> NOT FOUND </font></td>"
    response.write "<td><font color=Blue> NOT FOUND </font></td>"
    For VarCount = 1 to 6
    response.write "<td><font color=grey> 0 </font></td>"
    Next
    response.write "</tr>"
    end if

    The next recordset (grand child- rs3 and 4) under the same circumstances with the same code gives the output...any reasons y??
    Last edited by hombre_de_las_ca; Apr 29, 2005 at 11:06.

  2. #2
    SitePoint Enthusiast hombre_de_las_ca's Avatar
    Join Date
    Apr 2005
    Location
    Bangalore, India
    Posts
    90
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    again found the problem...the probem was that since the rs2 did not have any value the " while not rs2.eof " will not execute which in turn will not check the if loop cuz it was in the while loop...: )
    Caveman

  3. #3
    Original Gangster silver trophy Thing's Avatar
    Join Date
    Oct 2000
    Location
    Philadelphia, PA
    Posts
    4,708
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Sometimes it helps to just write it out. I've solved many of my own problems by posting here.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •