Re: Can a boolean ever be set to null?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance




If I remember correctly, the Byte is the datatype that takes the least amount
of bits to store, which struck me as odd... you'd think a boolean would be a
single bit, either 0 or 1, right? apparently that's not the case though. A
boolean actually takes more bits to store than a Byte, which can be one of
255 numbers.

So I would think, based on that, that there would be plenty of room in
memory to store whether a boolean would be true, false, or null.

The workings of bits is way beyond me, but a boolean takes more memory to
store than 0-255, for whatever reason.

--
Jack Leach
www.tristatemachine.com

"I haven't failed, I've found ten thousand ways that don't work."
-Thomas Edison (1847-1931)



"Dirk Goldgar" wrote:

"JimBurke via AccessMonster.com" <u49905@uwe> wrote in message
news:987adb4854b40@xxxxxx
Does Access not allow
Null for a boolean because it only examines one bit when it's dealing with
boolean fields? Just curious as to why they can't be Null. That's the only
reason I can think of.


I'm not sure, but I suspect that all the boolean fields in a table may
actually be store in a block of bits, with one bit per field. This is
purely conjecture, but it would be a space-saving measure. In such a case,
there would be no way to indicate that the field is Null.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)

.



Relevant Pages

  • Re: TRUE is 0 is FALSE
    ... An explicit literal - in string form - for boolean values don't seem ... equivalent simpler code that does not store a boolean in a variable. ... it will reflect the exit status of the last command in the ... the prominent shells support some form ...
    (comp.unix.shell)
  • Re: How to work with multiple response sets in Access
    ... simple checkboxes. ... but it gets simpler if I have only one survey ... and a table to store each answer to each question for each survey ... store the values in a Boolean field in the answers table, ...
    (microsoft.public.access.tablesdbdesign)
  • Re: Crash saving boolean value to RS (Row cannot be located...)
    ... Brendan Reynolds ... > Close RecordSet ... > The issue I'm dealing with is that I was attempting to store the Gender ... >> What if you give the Boolean field a default value. ...
    (microsoft.public.data.ado)
  • Re: How to change the value of Boolean variable?
    ... store a Bit value to determine if Bold is set. ... Then evaluate that value to set the bold of your command buttons. ... >> variable to a differnt type - in your case string to boolean. ... >>> dim MyVar as Boolean ...
    (microsoft.public.vb.general.discussion)
  • Re: TMS DBAdvStringGrid - CheckBox Question
    ... checkbox type components and grids, the capability to work with values 'not ... boolean' type, so, our library is fully compatible with Firebird. ... > Now I must solve that Firebird database not have a native boolean ... >> and it should display checkboxes for these boolean fields ...
    (borland.public.delphi.thirdpartytools.general)