Single Quote in Query Task - Failure

5404
4
Jump to solution
06-07-2011 05:48 AM
LakshmananVenkatesan
Occasional Contributor II
All,

Whenever we do a query task with column value having a single quote ESRI query task fails. We are using 2.1 version. Please let us know if there is any solution for this.

Thanks
SR
0 Kudos
1 Solution

Accepted Solutions
LakshmananVenkatesan
Occasional Contributor II
Thanks. Solution Found, we need to add another single quote

user = 'OU=BOIS D''XYZ EXPLORATION ABC,DC=HIGH2010W,DC=COM'

View solution in original post

4 Replies
DominiqueBroux
Esri Frequent Contributor
As the single quote is used as string delimiter, you have to escape it if you want it inside a string.

Something like:
   query.Where = "City = 'Bois D\'Arcy' ";

Are you talking about this case or something else?
0 Kudos
LakshmananVenkatesan
Occasional Contributor II
It is failing still : Sample

user = 'OU=BOIS D\'XYZ EXPLORATION ABC,DC=HIGH2010W,DC=COM'
0 Kudos
LakshmananVenkatesan
Occasional Contributor II
Thanks. Solution Found, we need to add another single quote

user = 'OU=BOIS D''XYZ EXPLORATION ABC,DC=HIGH2010W,DC=COM'
YousefQuran
Occasional Contributor

Thank you, it works fine!

0 Kudos