How are empty fields treated?

M

Martin Stabrey

Hello all

What exactly is inside a field that is left empty/blank inside an Access DB.
My question relates to how these empty fields are treated by an aspx web
page I have that searches for records in this DB. As an example, if a field
XYZ is left empty in the DB, and a Textbox in the aspx web page which
queries this field is left blank by the user, are two two equal?

Mart
 
J

John W. Vinson

Hello all

What exactly is inside a field that is left empty/blank inside an Access DB.
My question relates to how these empty fields are treated by an aspx web
page I have that searches for records in this DB. As an example, if a field
XYZ is left empty in the DB, and a Textbox in the aspx web page which
queries this field is left blank by the user, are two two equal?

Mart

Not sure about ASP, but within Access, a NULL field is empty, undefined,
uninitialized, unspecified. As such NULL is not equal (or, for that matter,
UNequal) to anything else, even another NULL. A comparison of NULL to any
other value returns - not true, not false - but NULL.

In practice this is treated as if the comparison were false, but this can be
misleading, because you can get apparent anomalies like

X = Y <treated as false because Y happens to be NULL>
X <> Y <ALSO treated as false because Y is NULL>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top