Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP 3.0 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 24th, 2005, 09:35 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , USA.
Posts: 100
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to ~Bean~
Default Checking for Null

How do I check for a null value in a boolean field in my DB?

I keep getting a type mismatch error when trying to check the field for a value and I know it has a null value in the DB...

???


-------------------------
Beware of programmers with screwdrivers...
__________________
-------------------------
Beware of programmers with screwdrivers...
  #2 (permalink)  
Old June 24th, 2005, 08:14 PM
Friend of Wrox
Points: 793, Level: 10
Points: 793, Level: 10 Points: 793, Level: 10 Points: 793, Level: 10
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2005
Location: OKC, OK, USA.
Posts: 227
Thanks: 1
Thanked 7 Times in 7 Posts
Default

You would get the mismatch error because a Boolean field is always a bit-field, meaning the bit is either on or off, '1'B or '0'B, in basic it is either '-1'B or '0'B, but never null. However you can set the bit, as a default value.

Hope this helps.

peace95
  #3 (permalink)  
Old June 27th, 2005, 07:09 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , USA.
Posts: 100
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to ~Bean~
Default

Thanks. The table I am working with has about 2000 records and whoever set it up in the beginning allowed null values in the boolean fields. Now most of the bools are filled with null, as well as a few date fields and others too.

I guess I can use a simple function to check for true/false and return false if there's an (type mismatch) error, but I guess I was hoping there was something like IsNull() for bools in ASP...

-------------------------
Beware of programmers with screwdrivers...
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error checking for table fields null value constra method Access VBA 1 September 26th, 2005 09:00 PM
How to set Not Null constraint to Null Columns arasu Oracle 1 August 22nd, 2005 10:09 AM
Checking for Null Values asmodeus BOOK: Beginning VB.NET Databases 2 June 3rd, 2005 03:18 PM
Checking null values in Query(SQL Server) Prob leo_vinay Classic ASP Databases 2 December 28th, 2004 04:31 AM
checking for duplicates jammykam Access 3 October 2nd, 2003 08:06 PM



All times are GMT -4. The time now is 10:02 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.