Purpose
The members of this ENum are used by the Find series of functions.
They allow you to specify how searches will be performed.
Syntax
Long
= <rtCDP_FindOptions>
| rtCDP_FindDefault
(0) |
|
Use
default searching rules. Only exact matches will be found
when conducting this king of search. |
| rtCDP_FindWithin
(1) |
|
The
data you are searching for can be contained anywhere within
the data being searched in order to be considered a match. |
| rtCDP_FindNoCase
(2) |
|
The
data you are searching for does not have to match the data
being searched in order to be considered a match. |
Notes
The most common usage of this ENum will be when using the Find
series of functions. They allow you to specify exactly how the
search will be conducted.
Values
of this ENum can be added together if you want to specify more
than one option. For example:
rtCDP_FindWithin
+ rtCDP_FindNoCase
...will
search within a string for any occurence of another string. The
search will not be case sensitive.
If
you add rtCDP_FindDefault
to any other find option, it will have no effect. In other words
rtCDP_FindWithin
and
rtCDP_FindDefault
+ rtCDP_FindWithin
function
exactly the same way.
Example
Objective:
Demonstrate several usages of the rtCDP_FindOptions
ENum.
'Create
the object
Dim CDP As
rtCDP.crtCDP
Set CDP = New
rtCDP.crtCDP
'Append a new record
CDP.Append "Name", "John Doe"
CDP.Append
"Name", "Billy Joe"
The
current state of the database
| Rec |
Key |
Data |
| 0 |
Name |
John
Doe |
| 1 |
Name |
Billy
Jean |
'Now
search for some data
Dim
RecNum As Long
RecNum = CDP.Find("Billy Jean", rtCDP_FindDefault)
'RecNum
now equals 1
RecNum
= CDP.Find("Jean", rtCDP_FindDefault)
'RecNum
now equals -1
RecNum
= CDP.Find("Jean", rtCDP_FindWithin)
'RecNum
now equals 1
RecNum
= CDP.Find("jean", rtCDP_FindWithin)
'RecNum
now equals -1
RecNum
= CDP.Find("jean", rtCDP_FindWithin
+ rtCDP_FindNoCase)
'RecNum
now equals 1
RecNum
= CDP.Find("j", rtCDP_FindWithin
+ rtCDP_FindNoCase)
'RecNum
now equals 0
RecNum
= CDP.Find("j", rtCDP_FindWithin)
'RecNum
now equals -1
RecNum
= CDP.Find("", rtCDP_FindWithin
+ rtCDP_FindNoCase)
'RecNum
now equals -1
RecNum
= CDP.Find("billy jean", rtCDP_FindDefault)
'RecNum
now equals -1
RecNum
= CDP.Find("billy jean", rtCDP_FindNoCase)
'RecNum
now equals 1
Version
History
1.0 2/20/2001 Tested
See
Also
rtCDP_ErrorNumber