Page 1 of 1

Filter strings with LIKE statements involving single quotation characters

Posted: Tue 20 Jun 2006 08:02
by datkins
Hi,

Need to set the filter string to a LIKE string with a single quote in it, I guess there must be a real simpe way to get ODAC to do the ecsaping of the string for me but I can't fidn it, can any one advise ?

Thanks

Posted: Wed 21 Jun 2006 09:03
by Plash
Two sequential apostrophes in a quoted string denote a single apostrophe. When you set Filter property from Object Pascal code you can use QuotedStr function. For example:

Code: Select all

  Filter := 'Name LIKE ' + QuotedStr('A''b*');