J
Jack Leach
Hello.
I've recently saw a post of some code that utilized the Option Compare Text
statement, and led me to do some investigation on what this really means.
I'm a bit stuck on a full understanding of Comapre Database though.
from help:
Option Compare Database can only be used within Microsoft Access. This
results in string comparisons based on the sort order determined by the
locale ID of the database where the string comparisons occur.
What is the default sort order a database (I assume the locale ID is default
depending on country). Is this a hybrid of both the Binary and Text compares
(Compare Database apparently will always be case-insensitive)? I can't seem
to find any deeper information on this.
I'm considering switching to Compare Binary as a default for certain
modules, but not exactly sure how the sort order will effect other areas of
my code, as I can't seem to find what exactly the sort order is on Compare
Database (my only reason for using Binary would be case-sensitivity, but am
not sure how the sort order will effect anything else).
Also, when using testing out the strcomp() function, which is supposed to
default to vbBinaryCompare, "A" and "a" return the same... I thought binary
was supposed to read these as different? Here's some immediate window lines
I'm getting...
?strcomp("A", "a", vbBinaryCompare)
-1
?strcomp("A", "a")
0
the default compare for strcomp() is supposed to be vbBinaryCompare (at
least that's what the argument popup says when entering info in the
function). If I were to change my Option Compare statement to effect the
results of this function, it makes the usuage of the function in the first
place a bit of a moot point... (of course, this if fairly trivial, as one
could always explicitly enter the vbBinaryCompare to make sure).
Just curious... I don't care for things I don't know and can't seem to find
what the sort order for Compare Database really is (and if it has any effect
on the default compare method for the strcomp() function).
Thanks for any input.
--
Jack Leach
www.tristatemachine.com
"I haven't failed, I've found ten thousand ways that don't work."
-Thomas Edison (1847-1931)
I've recently saw a post of some code that utilized the Option Compare Text
statement, and led me to do some investigation on what this really means.
I'm a bit stuck on a full understanding of Comapre Database though.
from help:
Option Compare Database can only be used within Microsoft Access. This
results in string comparisons based on the sort order determined by the
locale ID of the database where the string comparisons occur.
What is the default sort order a database (I assume the locale ID is default
depending on country). Is this a hybrid of both the Binary and Text compares
(Compare Database apparently will always be case-insensitive)? I can't seem
to find any deeper information on this.
I'm considering switching to Compare Binary as a default for certain
modules, but not exactly sure how the sort order will effect other areas of
my code, as I can't seem to find what exactly the sort order is on Compare
Database (my only reason for using Binary would be case-sensitivity, but am
not sure how the sort order will effect anything else).
Also, when using testing out the strcomp() function, which is supposed to
default to vbBinaryCompare, "A" and "a" return the same... I thought binary
was supposed to read these as different? Here's some immediate window lines
I'm getting...
?strcomp("A", "a", vbBinaryCompare)
-1
?strcomp("A", "a")
0
the default compare for strcomp() is supposed to be vbBinaryCompare (at
least that's what the argument popup says when entering info in the
function). If I were to change my Option Compare statement to effect the
results of this function, it makes the usuage of the function in the first
place a bit of a moot point... (of course, this if fairly trivial, as one
could always explicitly enter the vbBinaryCompare to make sure).
Just curious... I don't care for things I don't know and can't seem to find
what the sort order for Compare Database really is (and if it has any effect
on the default compare method for the strcomp() function).
Thanks for any input.
--
Jack Leach
www.tristatemachine.com
"I haven't failed, I've found ten thousand ways that don't work."
-Thomas Edison (1847-1931)