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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

empty field in recordset - null value

Status
Not open for further replies.

Bastien

Programmer
May 29, 2000
1,683
CA
Hi guys,
how do I deal with empty fields in a recordset...the server.htmlEncode function can not produce an empty field i.e. ""
How can I get around this to fix this up...

if HTMLEncode (objRS(x))="" then
Response.Write &quot;No Result</td></tr>&quot;
else %>
<%=objRS(x)%></td></tr>
<%
end if

thank
bastien
 
I believe the correct syntax you are looking for is:

if HTMLEncode objRS.EOF = True Then

 
I take it that the code you posted above does not work. You need to check if the field is null, rather than &quot;&quot;. If that makes sense! Null is a different state than containing nothing. So you code should be...

if HTMLEncode IsNull(ObjRS(x)) then
Response.Write &quot;No Result</td></tr>&quot;
else %>
<%=objRS(x)%></td></tr>
<%
end if


Hope this helps...
Gee

-GTM Solutions, Home of USITE-
-=
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top