![]() | |
![]() |
| | Thread Tools | Display Modes |
#11
| |||
| |||
|
|
In other words, you're not solving or avoiding having to deal with null columns. Since that's the case, most of us find it better to adopt a programming standard that nothing in a column is saved as null. And it means all over code by adopting this standard it allows us to work with those nulls that you can't avoid anyway. |
#12
| |||
| |||
|
|
"Albert D. Kallal" <PleaseNOOOsPAMmkal... (AT) msn (DOT) com> wrote innews:%SKmn.13884$QL4.716 (AT) newsfe24 (DOT) iad: In other words, you're not solving or avoiding having to deal with null columns. Since that's the case, most of us find it better to adopt a programming standard that nothing in a column is saved as null. *And it means all over code by adopting this standard it allows us to work with those nulls that you can't avoid anyway. Excellent thoughts, Albert. But I think a more clear way to say is that with ZLS off, Null means only one thing, that the value in the field is unknown. It's possible to impute meaning to a ZLS string as distinct from Null, but as you say, it's hard to maintain that distinction in a field (though I guess Not Null as validation rule and "" as default value would prohibit a stored value of Null), let alone with outer joins. I have never understood the irrational fear of Nulls, to be honest. That said, most of the times I've encountered ZLS's has been in databases built by people who were just beyond their level of comprehension, and in most cases did it because they had to append data with ZLS's in the fields (this has very often been the case when a web application was involved), and didn't know how to work around it. That is, allowing the ZLS had no actual particular meaning, it was just a kludge to work around a problem created by a problem beyond the programmer's ability to solve. Me, I wrote a ZLS-to-Null function years and years ago. It's appended after my signature (from a period in which I appended Leszinski-Reddick prefixes to my function names to indicate return type -- I don't do that systematically any longer, only when there's possible ambiguity). -- David W. Fenton * * * * * * * * *http://www.dfenton.com/ usenet at dfenton dot com * *http://www.dfenton.com/DFA/ Public Function varZLStoNull(varInput As Variant) As Variant * If Len(varInput) = 0 Then * * *varZLStoNull = Null * Else * * *varZLStoNull = varInput * End If End Function |
#13
| |||||||||||||
| |||||||||||||
|
|
On Mar 13, 8:39*pm, "David W. Fenton" XXXuse... (AT) dfenton (DOT) com.invalid> wrote: You are completely right about the use of NULL-values, because that is the way Access works! |
|
And that is good, for Dates and Numerics. |
|
With Text- and Memo-fields it is a little different. |
|
There is information in that field (Len > 0) or not. In the latter case you can describe that with NULL (Standard Access) or ZLS. |
|
The end-user does not see any difference between NULL of ZLS. |
|
I am a little pragmatic. I have not met a situation where I had to use NULL instead of ZLS, but I have a couple of examples it is profitable to use ZLS instead of NULL. |
|
Though using Standard Access is also very advantageous. LEFT JOIN's do return NULL values, but you can easily catch them with testing for Value > "". |
|
To find out which records have no LEFT JOIN I usually test for ForeignKey = NULL. |
|
And indeed, it is very handy to use the string-operator "+", that skips NULL-values, |
|
but a simple function can do the same on ZLS. |
|
On the other hand, many Standard Access string functions can not handle NULL values, and do return an error. So, it is a trade off. |
|
I must admit that I am not a Standard Access user. I do not use QueryDefs, Reports, Macros, Taskbars. I have generalized almost anything, so that I use a couple of definition tables and a handful of standard forms, in which all functionality (and more than Access offers) is available, to make any application. Within this systematics I feel more and more the advantages of ZLS, for string manipulation. |
|
Here we are in a discussion group. My contribution is that there is more than Standard Access. |
#14
| |||
| |||
|
|
With Text- and Memo-fields it is a little different. There is information in that field (Len > 0) or not. In the latter case you can describe that with NULL (Standard Access) or ZLS. The end-user does not see any difference between NULL of ZLS. LEFT JOIN's do return NULL values, but you can easily catch them with testing for Value > "". To find out which records have no LEFT JOIN I usually test for ForeignKey = NULL. |
![]() |
| Thread Tools | |
| Display Modes | |
| |