PDA

View Full Version : Empty Variables/Fields in ASP


ubelt
03-26-2004, 01:29 AM
I have always had problems evaluation expressions using an empty variable or field (from a recordset).

I have used the following:

if samplevar = '' then
if length(samplevar) = 0 then

however, none of these expressions prove true. i have also tried using "Is Null" or "= Null" but I get an error.

Anybody knows of a way to handle them?

Thanks.

Scott
03-26-2004, 08:49 AM
If you are dealing with a text type field from a recordset then try either:

if samplevar.tostring = '' then
if samplevar.tostring.length = 0 then