RowFilter Problem

  • Thread starter Thread starter Cuck
  • Start date Start date
C

Cuck

I have a situation where there are >' single quotes in my data. When I try
to set the rowfilter to that, with the single quote in it I, I get an error,
I've tried using escape codes and braces and that fails too...
..RowFilter = "Place = 'Joe's Place'" will fail
any ideas?

Thanks Chuck
 
Chuck,

Have you tried "escaping" (Replace each single quote by two single quotes)
them ?

..RowFilter = "Place=''Joe''s Place''"

Regards,
Jan
 
Unfortunitly that doesn't work either. For this line of code:
MyView.RowFilter = "Artist = ''Guns N'' Roses''"

I get: An unhandled exception of type 'System.Data.SyntaxErrorException' occurred in system.data.dll

Additional information: Syntax error: Missing operand after 'Guns' operator.

If I change it to MyView.RowFilter = "Artist = 'Guns N'' Roses'" ; additional tick after the N
I don't get an error but the filter is actually set to "Artist = 'Guns N'' Roses" (Two ticks after the N) and it doesn't not reconize the record for Artist = 'Guns N' Roses (one tick ofter the N)
I really can't believe this is as agrivating as it is. Escape codes doen't work; \' and bracketing doesn't work [']
 
Chuck,

Sorry, my first suggestion was certainly wrong.

In .RowFilter = "Artist = 'Guns N'' Roses'", are you using 2 single quotes
after the N ?
(2Artist1Guns N11Roses12)
That should work as far as I can see. (haven't tried it.)

and the first one should be :

.RowFilter = "Place='Joe''s Place'" (2Place=1Joe11s Place12)

Regards,
Jan


Unfortunitly that doesn't work either. For this line of code:
MyView.RowFilter = "Artist = ''Guns N'' Roses''"
I get: An unhandled exception of type 'System.Data.SyntaxErrorException'
occurred in system.data.dll
Additional information: Syntax error: Missing operand after 'Guns' operator.

If I change it to MyView.RowFilter = "Artist = 'Guns N'' Roses'" ;
additional tick after the N
I don't get an error but the filter is actually set to "Artist = 'Guns N''
Roses" (Two ticks after the N) and it doesn't not reconize the record for
Artist = 'Guns N' Roses (one tick ofter the N)
I really can't believe this is as agrivating as it is. Escape codes doen't
work; \' and bracketing doesn't work [']
 
Chuck,

A final suggestion (escaping with []), in case my previous suggestion fails
:

..RowFilter = "Artist = 'Guns N['] Roses'"
(2Artist=1Guns N[1] Roses12)
..RowFilter = "Place='Joe[']s Place'"
(2Place=1Joe[1]s Place12)

Hope at least one of these works,
Jan



Jan said:
Chuck,

Sorry, my first suggestion was certainly wrong.

In .RowFilter = "Artist = 'Guns N'' Roses'", are you using 2 single quotes
after the N ?
(2Artist=1Guns N11Roses12)
That should work as far as I can see. (haven't tried it.)

and the first one should be :

.RowFilter = "Place='Joe''s Place'" (2Place=1Joe11s Place12)

Regards,
Jan


Unfortunitly that doesn't work either. For this line of code:
MyView.RowFilter = "Artist = ''Guns N'' Roses''"
I get: An unhandled exception of type 'System.Data.SyntaxErrorException'
occurred in system.data.dll
Additional information: Syntax error: Missing operand after 'Guns' operator.

If I change it to MyView.RowFilter = "Artist = 'Guns N'' Roses'" ;
additional tick after the N
I don't get an error but the filter is actually set to "Artist = 'Guns N''
Roses" (Two ticks after the N) and it doesn't not reconize the record for
Artist = 'Guns N' Roses (one tick ofter the N)
I really can't believe this is as agrivating as it is. Escape codes doen't
work; \' and bracketing doesn't work [']



Jan said:
Chuck,

Have you tried "escaping" (Replace each single quote by two single quotes)
them ?

.RowFilter = "Place=''Joe''s Place''"

Regards,
Jan
 
Jan,
Bless you. I've gone cross eyed looking at this thing and was expecting
a differant result and was assuming that the single quote was causing it.
When I was reading the property back it was giving me two single quotes ''
after the N. This does filter for the corect records though. Thanks again
for the help.

Chuck

Jan said:
Chuck,

Sorry, my first suggestion was certainly wrong.

In .RowFilter = "Artist = 'Guns N'' Roses'", are you using 2 single quotes
after the N ?
(2Artist1Guns N11Roses12)
That should work as far as I can see. (haven't tried it.)

and the first one should be :

.RowFilter = "Place='Joe''s Place'" (2Place=1Joe11s Place12)

Regards,
Jan


Unfortunitly that doesn't work either. For this line of code:
MyView.RowFilter = "Artist = ''Guns N'' Roses''"
I get: An unhandled exception of type 'System.Data.SyntaxErrorException'
occurred in system.data.dll
Additional information: Syntax error: Missing operand after 'Guns' operator.

If I change it to MyView.RowFilter = "Artist = 'Guns N'' Roses'" ;
additional tick after the N
I don't get an error but the filter is actually set to "Artist = 'Guns N''
Roses" (Two ticks after the N) and it doesn't not reconize the record for
Artist = 'Guns N' Roses (one tick ofter the N)
I really can't believe this is as agrivating as it is. Escape codes doen't
work; \' and bracketing doesn't work [']



Jan said:
Chuck,

Have you tried "escaping" (Replace each single quote by two single quotes)
them ?

.RowFilter = "Place=''Joe''s Place''"

Regards,
Jan
 
Thanks for Jan's quick response.

Hi Chuck,

I'm glad to know that you have had the problem resolved. If you have any
further questions, please feel free to post them in the community, I will
try my best to help.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 
Back
Top