Solved

ADODB Recordset Find error

Posted on 2002-04-08
2
219 Views
Last Modified: 2011-10-03
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
0
Comment
Question by:pvandelouw
2 Comments
 
LVL 43

Accepted Solution

by:
TimCottee earned 40 total points
Comment Utility
Just double the ' character:

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

0
 

Author Comment

by:pvandelouw
Comment Utility
thank you very much, and really quick too. thanks

greetingz paul
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now