ADODB Recordset Find error

Hello

I have the following situation, i have a disconnected recordset. and now in my client i want to search for a specific item.
It works fine but when i have a ' in my string it isn't working. thats ofcourse because of the ' in the string.
my code is the following

value = "it's a test"

RS.Find("field = '" & value & "'")

How can i solve my problem, is there an escape charater for this problem.

greetingz Paul
pvandelouwAsked:
Who is Participating?
 
TimCotteeHead of Software ServicesCommented:
Just double the ' character:

RS.Find "Field = '" & Replace(Value,"'","''") & "'"

0
 
pvandelouwAuthor Commented:
thank you very much, and really quick too. thanks

greetingz paul
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.