how to check if a field has a value in a recordset? (Full Version)

All Forums >> [Web Development] >> ASP and Database



Message


cswolf -> how to check if a field has a value in a recordset? (4/24/2008 12:46:40)

Hi all,

I've got some code here on a web page that I did not write that connects to an MS Access DB, searches it, and then displays the results for you. It is an internal phone directory. A question has come up where we would like for any entry in the DB that does not have a value for the "Title" field to not be displayed in the results. I was thinking some sort of filter would be able to do this, but I am not exactly sure how. How can I check if there is a value for something in a recordset, then if there is a value have it display the information, and if not just move on to the next record? I am using classic ASP by the way.

I was thinking it would be something like this:

<% check if "Title" field has value in recordset. If it does, Then

Display information here (I have this code already)

Else

Go to next record

End If %>

How would I do that? Thanks!




rdouglass -> RE: how to check if a field has a value in a recordset? (4/24/2008 13:23:03)

quote:

check if "Title" field has value in recordset. If it does, Then


If trim(rs("Title") & "") > "" Then

That should be close.




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
8.203125E-02