Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Check for no value in db field

Status
Not open for further replies.

westcoaststyle

Programmer
Oct 15, 2001
81
US
Hello everyone, I have a rather stupid question for you:

I'm working with an Access DB and I have many fields that do not have data in them. I am using a do until EOF and for loop to display the data according to certain conditions... easy enough.

Well, when my for loop returns no data I want to have it create the table column with a red background, but I can't figure out how to make the ASP see that that data is null or nonexistant.

Here is the code I'm using:
Code:
<%
for each x in hwconfigrs.Fields
if x.name<>&quot;ID&quot; then
if x.value=&quot;&quot; then%>
   <td align=&quot;center&quot; width=&quot;20%&quot; bgcolor=&quot;#FF0000&quot;>NONE</td>
<%else%>
   <td align=&quot;center&quot; width=&quot;20%&quot;><%Response.Write(x.value)%></td>
<%end if
end if
next
%>

What's odd is that when I change the if statement from x.value=&quot;&quot; to x.value<>&quot;&quot; those fields that are null in the db still don't display as red... I'm thinking that Access may hold a null value in a certain way.

Any ideas?

Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top