Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / ASP / Database Access / December 2007



Tip: Looking for answers? Try searching our database.

recordset fields checking against NULL value?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
pedestrian - 06 Nov 2007 07:51 GMT
I've an ASP page with a ADO recordset, namely rst.

how could I check for a NULL value in the VB Script ASP?

Is the below correct?

If rst.Fields("MyColumn") Is NULL Then
   ....
Else
  ....
End If

What is the correct way to check a specific column value whether is it NULL
value?

Thanks!

Signature

Regards,
Pedestrian, Penang.

pedestrian - 06 Nov 2007 07:55 GMT
I've found the answer :

If rst.Fields("MyColumn") Is Nothing Then
...

I was finding the equivalent of DBNull.Value of .NET

>I've an ASP page with a ADO recordset, namely rst.
>
[quoted text clipped - 12 lines]
>
>Thanks!

Signature

Regards,
Pedestrian, Penang.

pedestrian - 06 Nov 2007 08:13 GMT
The correct one should be:

If (rst.Fields("OldTypeOfLeave") = "NULL") Then
  ...

>I've found the answer :
>
[quoted text clipped - 8 lines]
>>
>>Thanks!

Signature

Regards,
Pedestrian, Penang.

Evertjan. - 06 Nov 2007 08:30 GMT
pedestrian via WebmasterKB.com wrote on 06 nov 2007 in
microsoft.public.inetserver.asp.db:

> The correct one should be:
>
> If (rst.Fields("OldTypeOfLeave") = "NULL") Then
>    ...

"The correct" is a dangerous presumption.

So Null is a string????

[And please do not toppost on usenet]

If isNull(rst.Fields("OldTypeOfLeave")) Then

Signature

Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

quantumkev - 13 Dec 2007 21:06 GMT
> pedestrian via WebmasterKB.com wrote on 06 nov 2007 in
> microsoft.public.inetserver.asp.db:
[quoted text clipped - 11 lines]
>
> If isNull(rst.Fields("OldTypeOfLeave")) Then
quantumkev - 13 Dec 2007 21:08 GMT
Evertjan -

Thank you so much for the helpful info. I was just wrestling with a similar
issue, and found your post after searching the web. It got me up and going
again - appreciate it.

> pedestrian via WebmasterKB.com wrote on 06 nov 2007 in
> microsoft.public.inetserver.asp.db:
[quoted text clipped - 11 lines]
>
> If isNull(rst.Fields("OldTypeOfLeave")) Then
Evertjan. - 14 Dec 2007 08:14 GMT
=?Utf-8?B?cXVhbnR1bWtldg==?= wrote on 13 dec 2007 in
microsoft.public.inetserver.asp.db:

> Evertjan -
>
> Thank you so much for the helpful info. I was just wrestling with a
> similar issue, and found your post after searching the web. It got me
> up and going again - appreciate it.

I wrote this 6 november ;-)

>> pedestrian via WebmasterKB.com wrote on 06 nov 2007 in
>> microsoft.public.inetserver.asp.db:
[quoted text clipped - 9 lines]
>>
>> [And please do not toppost on usenet]

See below, why still persist in topposting?
And please do not quote signatures on usenet,
that's what the -- starting line is for.

Usenet netiquette is sensible.

>> If isNull(rst.Fields("OldTypeOfLeave")) Then

Signature

Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.