Re: RowFilter where expression contains a single quote (such as O'Doul

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance




"michael" <michael@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:D17C82E3-A861-4AFC-99D6-DBAFF0CA0B2E@xxxxxxxxxxxxxxxx
I need to set a RowFilter where a value(string) is compared to the value in
a
column, such as "[LastName]=' " & strLast & " ' ".

Let's say the strLast has a value of O'Doul. When strLast is evaluated,
the
extra single quote causes the RowFilter string to fail. I know that
somehow
the single quote in O'Doul needs to be "escaped", but I can't quite figure
out the context. I tried replacing the single quote in strLast with a
backslash single quote( \' ), but that failed too.

How do I deal with an expression that contains this single quote?
--
Michael

I double all single quote characters. I replace ' with ''.

--
Richard Mueller
MVP Directory Services
Hilltop Lab - http://www.rlmueller.net
--


.



Relevant Pages