Question about using FindFirst on strings containing quotes in an indexed field

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
 
W

Wei Lu [MSFT]

Hello Carl,

Does this issue appeared on all the Access mdb file?

I have searched in our database and do not find any similar issue.

Would you please try to build a simple file and send it to me so that I can
re-produce on my side?

You could zip the file and send it to me directly. To get my email, please
remove the ONLINE in my email address line.

Thank you!

Sincerely,

Wei Lu

Microsoft Online Community Support

==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.

==================================================
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 
W

Wei Lu [MSFT]

Hello Carl,

I am sorry that I still perform some research on this issue.

I apprieciate your understood.

Sincerely,

Wei Lu

Microsoft Online Community Support

==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.

==================================================
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top