Empty Variables/Fields in ASP

Discussion in 'Classic ASP' started by ubelt, Mar 26, 2004.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. 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.
     
  2. 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
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page