Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Detecting empty or null value?

0 views
Skip to first unread message

jodleren

unread,
Oct 27, 2009, 2:28:31 PM10/27/09
to
Hello all

I tryid to find anything here, but not exactly what I need. My
solution as of now is:

sMine=rsjob.fields(0).value
if sMine & ""="" then sMine="undefined"

Just how should it be properly done?

if smine="" or smine=NULL then ?
The =null does not work :)

What is the right thing then?

WBR
Sonnich

Bob Barrows

unread,
Oct 27, 2009, 2:41:17 PM10/27/09
to
jodleren wrote:
> Hello all
>
> I tryid to find anything here, but not exactly what I need. My
> solution as of now is:
>
> sMine=rsjob.fields(0).value
> if sMine & ""="" then sMine="undefined"

Nothing is wrong with that. Is it giving you the wrong answer?


>
> Just how should it be properly done?
>
> if smine="" or smine=NULL then ?
> The =null does not work :)
>

vbscript has two ways of testing for null:

if sMine Is Null then

or

if IsNull(sMine) then

Either works.

--
HTH,
Bob Barrows


rob^_^

unread,
Dec 12, 2009, 1:53:36 PM12/12/09
to
Hi,

Just append a zero length string to convert nulls to zero length strings.
sMine=rsjob.fields(0).value & ""

for string fields. For numeric fields, make sure they do not allow nulls and
that the default binding value is valid.

This also works for asp query parameters and makes coding in asp.net easier.

sValue = request("sValue") & ""

I/O

if not request("sValue") is nothing then
....etc.

Regards.

"jodleren" <son...@hot.ee> wrote in message
news:a5d4bd44-f60b-4817...@z3g2000prd.googlegroups.com...

0 new messages