 |
|
| Computers Forum Index » Computer - Databases - MS Access » FindFirsting unique strings... |
|
Page 1 of 1 |
|
| Author |
Message |
| Salad... |
Posted: Sun Oct 25, 2009 8:19 pm |
|
|
|
Guest
|
I am wondering what methodology you use, if you use FindFirst, to find
exact matches in a string.
If one uses linked tables, one can't use Seek.
One can't store different cases in a table and be unique. Ex: Smith
and smith. Both are the same.
With FindFirst there isn't a compare opton. If a table contained a part
number of ABC1234 and you entered ABC123 to find, the field would be
found. If you entered ABC12345 it would not be found. And of course,
if you entered ABC1234, it would be found. So the difference might be
the lengths of the field in determining if it were match and nomatch.
So one could do a FindFirst "PartNo = 'ABC1234' and Len(PartNo) = 7" and
you should be able to determine if one found a unique value or not. Do
you use a better or more effecient method? |
|
|
| Back to top |
|
|
|
| Chuck Grimsby... |
Posted: Sun Oct 25, 2009 8:19 pm |
|
|
|
Guest
|
On Oct 25, 11:19 am, Salad <o... at (no spam) vinegar.com> wrote:
Quote: I am wondering what methodology you use, if you use FindFirst, to find
exact matches in a string.
If one uses linked tables, one can't use Seek.
One can't store different cases in a table and be unique. Ex: Smith
and smith. Both are the same.
With FindFirst there isn't a compare opton. If a table contained a part
number of ABC1234 and you entered ABC123 to find, the field would be
found. If you entered ABC12345 it would not be found. And of course,
if you entered ABC1234, it would be found. So the difference might be
the lengths of the field in determining if it were match and nomatch.
So one could do a FindFirst "PartNo = 'ABC1234' and Len(PartNo) = 7" and
you should be able to determine if one found a unique value or not. Do
you use a better or more effecient method?
Personally, I don't use either Seek or FindFirst. I use a query.
You can use StrComp with the vbCompareBinary option if case
matters.... |
|
|
| Back to top |
|
|
|
| Tom van Stiphout... |
Posted: Mon Oct 26, 2009 5:15 am |
|
|
|
Guest
|
On Sun, 25 Oct 2009 09:19:04 -0700, Salad <oil at (no spam) vinegar.com> wrote:
If one uses linked tables, one can still use Seek: by opening a
back-end database object, a recordset (dbOpenTable) on a table in that
BE, and go to town. Seek is the fastest lookup method so it makes
sense where performance is critical.
Regarding case-insensitivity: this is true. SQL Server has a binary
sort mode if you need it. Be sure that you REALLY want it before going
there.
-Tom.
Microsoft Access MVP
Quote: I am wondering what methodology you use, if you use FindFirst, to find
exact matches in a string.
If one uses linked tables, one can't use Seek.
One can't store different cases in a table and be unique. Ex: Smith
and smith. Both are the same.
With FindFirst there isn't a compare opton. If a table contained a part
number of ABC1234 and you entered ABC123 to find, the field would be
found. If you entered ABC12345 it would not be found. And of course,
if you entered ABC1234, it would be found. So the difference might be
the lengths of the field in determining if it were match and nomatch.
So one could do a FindFirst "PartNo = 'ABC1234' and Len(PartNo) = 7" and
you should be able to determine if one found a unique value or not. Do
you use a better or more effecient method?
|
|
|
| Back to top |
|
|
|
|
|
All times are GMT
The time now is Wed Dec 09, 2009 1:37 am
|
|