Recordset problems

P

polilop

I have a recordset which i have to check if it is empty and if its not then
to print it out
something like

<% if Not(emptyStr=rsBoats.Fields.Item("Price_descr").Value) Then%>
<TR> <TD colSpan=4><div align="center"></div>
<div align="left"><span class="titl"><span class="maliNaslovi">Price
description</span></span> </div></TD>
</TR>
<TR><TD><div align="left"></div></TD>
<TD colSpan=2><div
align="left"><%=(rsBoats.Fields.Item("Price_descr").Value)%></div></TD>
<TD>&nbsp;</TD>
</TR>
<% End if%>

But the second one never prints out why?
 
B

Bob Barrows [MVP]

polilop said:
I have a recordset which i have to check if it is empty

Be more specific. Do you want to know if the recordset is empty (no
records)? Or do you want to test if a specific field contains data (as
appears to be the case from your attempt below)?
and if its
not then to print it out
something like

<% if Not(emptyStr=rsBoats.Fields.Item("Price_descr").Value) Then%>
<TR> <TD colSpan=4><div align="center"></div>
<div align="left"><span class="titl"><span
class="maliNaslovi">Price description</span></span> </div>
</TD>

?? Why do you have all the empty/nested divs and spans?
</TR>
<TR><TD><div align="left"></div></TD>
<TD colSpan=2><div
align="left"><%=(rsBoats.Fields.Item("Price_descr").Value)%></div></TD>
<TD>&nbsp;</TD>
</TR>
<% End if%>

But the second one never prints out why?

Huh? What second one?

I think you want to test if the field contains data, correct? Try this (I've
reformatted the html to make it a little more readable, as well as removing
the emptiy divs.):

<%
dim price
price = rsBoats("Price_descr").value
if len(price) = 0 then
price= 0
end if
%>
<TR>
<TD colSpan=4>
<div align="left">
<span class="titl">
<span class="maliNaslovi">
Price description
</span>
</span>
</div>
</TD>
</TR>
<TR>
<TD>
<div align="left"></div>
</TD>
<TD colSpan=2>
<div align="left">
<%=price%>
</div>
</TD>
<TD>&nbsp;</TD>
</TR>


Bob Barrows
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top