M
Matt Shudy
Hi,
I have a page that displays db results in a table. One
part of the asp code that makes this table is
Dim Field
Field = objNM("Field")
For i = 1 to 12
objPL.Filter="Month= " & i
If objPL(Field) <> "" Then
Response.Write "<TD>" & objPL(Field) & "</TD>"
Else
Resopnse.Write "<TD> </TD>"
End If
Next
Where objNM("Field") contains a list of all the row
headings ex.
field name filtered 1 to 12
Row one 1 2 3 4 5 6 7 8 9 10 11 12
Row two 1 2 3 4 5 6 7 8 9 10 11 12 and so on
The above code works fine, until objPL(Field)="", meaning
there is a row heading (ex Row three) but there is no data
to be displayed. With the above code the table will
populate until it gets to this, then it will error out and
stop populating the table. If i replace "If objPL(Field)
<> "" Then" with "If Not objPL.EOF Then" the table will
fully populate, but leave the rows with no data blank ex.
Row one 1 2 3 4 5 6 7 8 9 10 11 12
Row two 1 2 3 4 5 6 7 8 9 10 11 12
Row three
Row four 1 2 3 4 5 6 7 8 9 10 11 12
Is there something i can add to the above code so, if
there is no data for the given row heading it will just
print out a blank cell? So instead of printing out 12
cells with data in them, it would print out 12 blank
cells...
Thanks,
Matt Shudy
I have a page that displays db results in a table. One
part of the asp code that makes this table is
Dim Field
Field = objNM("Field")
For i = 1 to 12
objPL.Filter="Month= " & i
If objPL(Field) <> "" Then
Response.Write "<TD>" & objPL(Field) & "</TD>"
Else
Resopnse.Write "<TD> </TD>"
End If
Next
Where objNM("Field") contains a list of all the row
headings ex.
field name filtered 1 to 12
Row one 1 2 3 4 5 6 7 8 9 10 11 12
Row two 1 2 3 4 5 6 7 8 9 10 11 12 and so on
The above code works fine, until objPL(Field)="", meaning
there is a row heading (ex Row three) but there is no data
to be displayed. With the above code the table will
populate until it gets to this, then it will error out and
stop populating the table. If i replace "If objPL(Field)
<> "" Then" with "If Not objPL.EOF Then" the table will
fully populate, but leave the rows with no data blank ex.
Row one 1 2 3 4 5 6 7 8 9 10 11 12
Row two 1 2 3 4 5 6 7 8 9 10 11 12
Row three
Row four 1 2 3 4 5 6 7 8 9 10 11 12
Is there something i can add to the above code so, if
there is no data for the given row heading it will just
print out a blank cell? So instead of printing out 12
cells with data in them, it would print out 12 blank
cells...
Thanks,
Matt Shudy