473,407 Members | 2,546 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

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 1325
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

23
by: Rob Meade | last post by:
Lo all, Ok - this is what I was aiming to do, and then I thought - naahhh, that cant be right! query database results to recordset results to array using GetRows update values in one column...
1
by: ano1optimist | last post by:
Has anyone had success with using a command collection with parameters to run a stored procedure from sql server? I'm frustrated and have been spending way too much time trying to make this work. ...
0
by: CSDunn | last post by:
Hello, In Access ADP's that connect to SQL Server databases, any time I have a situation where I have a combo box in a main form that looks up a record in a subform, the subform record source has...
3
by: alex_peri | last post by:
Hello All, I am having problems with sorting a recordset by fields in Access. I have a table with three columns called ID, SNo and Time and would like to sort the records by Time. I would like to...
6
by: lenny | last post by:
Hi, I've been trying to use a Sub or Function in VBA to connect to a database, make a query and return the recordset that results from the query. The connection to the database and the query...
1
by: ora06 | last post by:
Hi everybody I am a newcomer in VC++ developement I work VC with Oracle database I want to manipulate the database with ADODB After connected , i do as follow: ------------------------...
7
by: marmottedodue | last post by:
Hello, I'm trying to debug an access project in which two kind of recordset are used: ADODB.recordset and DAO.recordset. I'm trying to set the whole project on DAO.recordset, but the following...
6
by: ZRexRider | last post by:
I've been reading the newsgroups and most of the solutions for this message are simple and obvious but unfortunately don't solve my problem. I have an MS-Access 2002 ADP application that...
6
by: Oko | last post by:
I'm currently developing an MS Access Data Project (.adp) in MS Access 2002. One of the reports within the DB uses data that is Dynamic and cannot be stored on the SQL Server. To resolve this, I...
2
by: MayoM | last post by:
The help on "Recordset Property" describes how you can bind a form to a recordset. I am trying to get this to work - in Access 2003 - in a subform - in the Form_Open event - assigning a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.