Print Page | Close Window

IsNull IsDriving me nuts

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=17487
Printed Date: 29 March 2026 at 10:15am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: IsNull IsDriving me nuts
Posted By: ctscott
Subject: IsNull IsDriving me nuts
Date Posted: 08 December 2005 at 11:46am
I need some wisdom from some of you fine people.  I am confused about IsNull and how an If statement is working.
 
1. the DB is SQL Server 2000
2. i only have read access on the Table
2. the Column in the Table is System__bUser__bID, vchar, 256, allow nulls
 
If the value in System__bUser__bID is "Vault" I am to bypass the record otherwise I am to check the next selection field.
 
The code:
IF ((rsCommon("System__bUser__bID")) <> "Vault")
   IF "next field" bla bla bla.....
 
This works like a champ....UNTIL....rsCommon("System__bUser__bID"))  is Null.  If it is Null then the field is treated as it is equal "Vault"  hence my heightened ignorance.  If i add "OR IsNull(rsCommon("System__bUser__bID")) = True" then it works like a champ again.
 
I just don't understand how Null equals Vault.   Any guidance is welcome.


-------------
______________________
http://www.cfbtrivia.com" rel="nofollow - College Football Trivia



Replies:
Posted By: michael
Date Posted: 08 December 2005 at 4:45pm
Sure it does not equal Vault, but NULL in databases actually means Nothing/no value.
NULL can become very confusing so I usually catch it at the database level like
Select IsNull(somefield,'') as somefield
That way it does not come down as null in the recordset and don't have to worry as them treating them just as a blank field but not nothing.
Uh I think I just confused myself, but I hope you understand what I mean.


-------------
http://baumannphoto.com" rel="nofollow - Blog | http://mpgtracker.com" rel="nofollow - MPG Tracker


Posted By: theSCIENTIST
Date Posted: 09 December 2005 at 1:27am
Remember null is not blank, and this is where most of the confusion comes from, null is raw, nothing, limbo, it does not contain a value, but it's not considered blank either, look at it as a unformatted disk, it is new, but it's not to be compared with a disk ready to take data in.

Check this alternate function: http://www.4guysfromrolla.com/webtech/031699-1.shtml

-------------
:: http://www.mylittlehost.com/ - www.mylittlehost.com



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net