From: Mat on
I generally set this to true for all fields other than fields that I
specify as required.

Considering the default value is false I am wondering if it is a good
or bad practise to set it true?
From: Tom van Stiphout on
On Thu, 11 Mar 2010 19:51:55 -0800 (PST), Mat
<matthew.kay(a)optusnet.com.au> wrote:

I think it's bad, because it will be difficult to distinguish between
NULL and a ZLS (zero-length string). So you'll often write:
select * from myTable
where myField is null or myfield=""

I prefer to use NULL exclusively.

-Tom.
Microsoft Access MVP


>I generally set this to true for all fields other than fields that I
>specify as required.
>
>Considering the default value is false I am wondering if it is a good
>or bad practise to set it true?
From: Allen Browne on
Like Tom, I think a zero-length string is confusing both for the user (who
can't see any difference between a Null and a ZLS and doesn't know how or
when they should enter a ZLS value), and for the developer (since most
databases I've seen don't handle this well.)

The default behavior in Access is not quite the quite you described it, Mat.
The default was false in older versions of Access, but true in more recent
versions. Inconsistent (version specific) is probably the worst possible
outcome.

So, I would encourage you to take Tom's advice and set it to No for all
fields, unless you have a very good, specific reason for needing a ZLS.

So, here's a bit of code that will go through your database and set
AllowZeroLengthString to No for all Text and Memo fields:
http://allenbrowne.com/bug-09.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.


"Tom van Stiphout" <tom7744.no.spam(a)cox.net> wrote in message
news:t0gjp5tkoso65nlu2l9t80shoh4vktj32t(a)4ax.com...
> On Thu, 11 Mar 2010 19:51:55 -0800 (PST), Mat
> <matthew.kay(a)optusnet.com.au> wrote:
>
> I think it's bad, because it will be difficult to distinguish between
> NULL and a ZLS (zero-length string). So you'll often write:
> select * from myTable
> where myField is null or myfield=""
>
> I prefer to use NULL exclusively.
>
> -Tom.
> Microsoft Access MVP
>
>
>>I generally set this to true for all fields other than fields that I
>>specify as required.
>>
>>Considering the default value is false I am wondering if it is a good
>>or bad practise to set it true?

From: hbinc on
On Mar 12, 4:51 am, Mat <matthew....(a)optusnet.com.au> wrote:
> I generally set this to true for all fields other than fields that I
> specify as required.
>
> Considering the default value is false I am wondering if it is a good
> or bad practise to set it true?

Hi Mat,

The availability of NULL-values for dates and numerics is essential.
For text- and memo-fields I have not yet - after 25 years - found any
preference of using NULL-values over zero-length-strings.

In all tables I use NULL-values as default, because Access97 did that.
And ONE way of working (always NULL) is far better than a mixed way of
working.
Recently I changed all my metadata-controls with text-values to zero-
length-string-defaults. In all the string-manipulation it is not
necessary anymore to make exceptions for NULL-values.

So, in due time, if I have very much time, I plan to change to the
other ONE way of working: always zero-length-string in text and memo-
fields.


HBInc.
From: Mat on
> Hi Mat,
>
> The availability of NULL-values for dates and numerics is essential.
> For text- and memo-fields I have not yet - after 25 years - found any
> preference of using NULL-values over zero-length-strings.
>
> In all tables I use NULL-values as default, because Access97 did that.
> And ONE way of working (always NULL) is far better than a mixed way of
> working.
> Recently I changed all my metadata-controls with text-values to zero-
> length-string-defaults. In all the string-manipulation it is not
> necessary anymore to make exceptions for NULL-values.
>
> So, in due time, if I have very much time, I plan to change to the
> other ONE way of working: always zero-length-string in text and memo-
> fields.
>
> HBInc.

Thanks for that reply. So the option is really asking me to choose
between null or zero length?

AllowZeroLength = true 'means vbnullstring
AllowZeroLength = false 'means null