468,101 Members | 1,539 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,101 developers. It's quick & easy.

Recordset problems

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").Va lue) 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?
Jul 22 '05 #1
2 1212
polilop wrote:
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").Va lue) 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
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Jul 22 '05 #2
Solved it OK!

"polilop" <fm******@inet.hr> wrote in message
news:d5**********@magcargo.vodatel.hr...
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").Va lue) 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?

Jul 22 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

23 posts views Thread by Rob Meade | last post: by
7 posts views Thread by marmottedodue | last post: by
1 post views Thread by Solo | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.