Hi Rich
You're right! I'm afraid I suffer from AAS (ADO Avoidance Syndrome) and I
had forgotten the restrictions on .Find.
There are two ways around it. You could use .Filter instead, which does
allow for more complex WHERE clause expressions. Or, you code a loop using
..Find to get the next case-insensitive match and check with StrComp if the
resulting record matches the case-sensitive criterion. If not, then repeat
the loop until you get a match or EOF.
If you are going to use .Filter then TC is right. Including the = criterion
should be much faster if the field you are searching is indexed.
--
Good Luck!
Graham Mandeno [Access MVP]
Auckland, New Zealand
Rich said:
Thanks all, but I can't seem to get it to work. As far as I can tell, the
ADO recordset.Find method doesn't allow for using the strComp function.
After trying different constructions, I found this in the "Access 2000
Developer's Handbook" by Getz, et. al.: "Criteria...can only consist of a
single field name, a comparison operator, and a value. Find does not handle
complex WHERE clause values."
The Jet engine is inherently case-insensitive? That seems really wonky to
me. I mean, if I look at the value in the table, it's displayed as "Bob".
So something different from "bob" was stored in the database. So if someone
wants to find a record with "Bob" instead of "bob", but they type in "bob"
by mistake, why would "Bob" get returned as OK? Is it actually converting
every string it finds in any field in any table to lower case before
operating on it? What a lot of overhead for something that I see as being
undesirable far more often than desirable!
In my case, I'm beginning to think it is actually desirable: the username
is case-insensitive, but the password -- which I'm comparing once the record
is found, using a a test which seems to adhere to the "option compare
binary" at the beginning of the module -- is case-sensitive. But overall?
I can't imagine that I'm going to be happy with this down the line in a
different situation.