Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 28th, 2008, 06:34 AM
Registered User
 
Join Date: Jan 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to cm.cruz
Default How do I handle NULL resultset field?

Hi All,

I just would like to ask, how do I handle null result set values queried from the database?

I tried using if-else statements to catch null values: if rs("column_name") is null then and if rs("column_name") = null then but to no avail. What is the proper way of handling null values from the database?

Using a Select query from the database, the result set using query analyzer looks like this:
Column1 Column2
0001 NULL
0002 NULL

Sorry to ask a very basic question. I'm new to ASP programming.

Thanks in advance!:)
 
Old January 28th, 2008, 06:29 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

isNull Function - Returns a Boolean value that indicates whether an expression contains no valid data ( Null).

IsNull(expression)

EG

if isNull(rs("column_name")) then
   'record has a null value
else
   'record is not null
end if

Wind is your friend
Matt
www.elitemarquees.com.au





Similar Threads
Thread Thread Starter Forum Replies Last Post
Handle Null or Blank values using xslt in csv data mums XSLT 1 April 3rd, 2008 07:30 PM
Replace Gridview field if null with new field Indo77 ASP.NET 2.0 Basics 1 June 18th, 2007 06:22 AM
how to handle null values imaginevictor ASP.NET 1.x and 2.0 Application Design 1 March 20th, 2007 01:52 AM
Copy previous field record if next field is null ecampos Access VBA 6 June 23rd, 2006 12:55 PM
Null Value for Date/Time Field ksegars4 Crystal Reports 2 November 17th, 2004 11:58 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.