C
Carl Rapson
I've run into an odd problem that I can't seem to find in any of the
archives. I'm using Access 2002 SP3 on Windows XP SP2.
I've got a table with an indexed text field, and the field may contain a
string that contains quotes (either single or double quotes). An example
would be the name O'Reilly. I use the Replace function to "double up" the
quotes before doing a FindFirst on the string:
rs.FindFirst "LastName= ' " & Replace(strClient, " ' ", " ' ' ") & " ' "
(spaces added for clarity). What I've found is that if I use the string
contains a quote of the same type as the delimiter (a single quote as in the
example above, or a double quote for a string that contains double quotes),
and the table field is indexed, the FindFirst function fails to find the
string. If I remove the index from the field, the FindFirst function finds
the string successfully.
Is this a known problem, or is there something I'm doing wrong? I've tried
various permutations on the FindFirst call (such as building the search
string piecemeal and even using the Char() function to embed the delimiting
quotes), but the search still fails if the text field is indexed.
Any suggestions or information qould be greatly appreciated.
Carl Rapson
archives. I'm using Access 2002 SP3 on Windows XP SP2.
I've got a table with an indexed text field, and the field may contain a
string that contains quotes (either single or double quotes). An example
would be the name O'Reilly. I use the Replace function to "double up" the
quotes before doing a FindFirst on the string:
rs.FindFirst "LastName= ' " & Replace(strClient, " ' ", " ' ' ") & " ' "
(spaces added for clarity). What I've found is that if I use the string
contains a quote of the same type as the delimiter (a single quote as in the
example above, or a double quote for a string that contains double quotes),
and the table field is indexed, the FindFirst function fails to find the
string. If I remove the index from the field, the FindFirst function finds
the string successfully.
Is this a known problem, or is there something I'm doing wrong? I've tried
various permutations on the FindFirst call (such as building the search
string piecemeal and even using the Char() function to embed the delimiting
quotes), but the search still fails if the text field is indexed.
Any suggestions or information qould be greatly appreciated.
Carl Rapson