This works well<BR><BR>If Len(rs("DOB") & "") = 0 then<BR><BR>By appending "" to the rs value, you stop it from being null, so one test can tell if the value is either empty or null.<BR><BR>===A weed a day keep your mind at play===
You can also set null values to some predetermined value directly in your query (provided your platform supports T_SQL):<BR><BR>SELECT ISNULL(someField, 'myGarbageString') AS myField FROM someTable<BR><BR>blah, blah, blah....<BR><BR>If RS.Fields("myField").value <> "myGarbageString" then.....<BR>
Try IsNull or IsEmpty depending on the use. If the variable is just "" then use the first statement you wrote in your question.<BR><BR>IsEmpty returns True if the variable is uninitialized, or is explicitly set to Empty. IsNull returns True if expression is Null, that is, it contains no valid data.
Why not just use<BR><BR>If Len(somevar) > 0 Then<BR> 'ya know it's not empty or NULL<BR><BR><BR>Thought you were the efficient guy ;)<BR><BR>You know better than anybody that string concat sucks in VBS -- though with something this small, who cares.
Because the variable will contain a properly trimmed value for use elsewhere in the page. I've had some SQL Server data types with special characters returned that I got bit on a couple of times. My less than 100% efficient method prevents this from happening...