Findfirst and ' problems 
Author Message
 Findfirst and ' problems

Hi,

I experience some problems with the findfirst, findlast... methods.
If the string searched contains a ' character (like l'amrique), the methods
fail.
I did experienced this problem with VB4. Is that bug corrected with VB6.

Best regards.



Mon, 05 Nov 2001 03:00:00 GMT  
 Findfirst and ' problems

Quote:

>Hi,
>I experience some problems with the findfirst, findlast... methods.
>If the string searched contains a ' character (like l'amrique), the methods
>fail.
>I did experienced this problem with VB4. Is that bug corrected with VB6.

Replace each ' with two, ''. Get the StrReplaceAll function from my site,
<http://members.ricochet.net/~jfoster/>, for an easy way to do this. Also,
the Find methods do have a bug that you can work around by parenthesizing,
like this:

RS.FindFirst "(field1 = '" & StrReplaceAll(Text1, "'", "''", 0) & "')"

--

WARNING: I cannot be held responsible for the above        They're   coming  to
because  my cats have  apparently  learned to type.        take me away, ha ha!



Mon, 05 Nov 2001 03:00:00 GMT  
 Findfirst and ' problems
The problem is, when I replace it, my  expression isn't the same anymore :

Joe 's Winters NOT IS Joe ''s Winters !!

How to solve this, I don't want to replace ' into two ' in my database

Yours,

Peter



Quote:

> >Hi,

> >I experience some problems with the findfirst, findlast... methods.
> >If the string searched contains a ' character (like l'amrique), the
methods
> >fail.
> >I did experienced this problem with VB4. Is that bug corrected with VB6.

> Replace each ' with two, ''. Get the StrReplaceAll function from my site,
> <http://members.ricochet.net/~jfoster/>, for an easy way to do this. Also,
> the Find methods do have a bug that you can work around by parenthesizing,
> like this:

> RS.FindFirst "(field1 = '" & StrReplaceAll(Text1, "'", "''", 0) & "')"

> --


<http://www.xenu.net/>

- Show quoted text -

Quote:
> WARNING: I cannot be held responsible for the above        They're
coming  to
> because  my cats have  apparently  learned to type.        take me away,
ha ha!



Tue, 06 Nov 2001 03:00:00 GMT  
 Findfirst and ' problems

Quote:

>The problem is, when I replace it, my  expression isn't the same anymore :
>Joe 's Winters NOT IS Joe ''s Winters !!
>How to solve this, I don't want to replace ' into two ' in my database

Don't worry, it's just an escape sequence, just like how you use two
ampersands to display an ampersand instead of defining a hotkey in a
label or use two double-quotes to embed a single double-quote in a
string constant.

Label1.Caption = "Ren && Stimpy"
MsgBox "Quoth the Raven, ""Nevermore."""
Data1.FindFirst "(fieldx = 'Joe ''s Winters')"

--

WARNING: I cannot be held responsible for the above        They're   coming  to
because  my cats have  apparently  learned to type.        take me away, ha ha!



Fri, 23 Nov 2001 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. FindFirst Problem - 'Too few parameters'

2. problems with 'FindFirst' method

3. Problem with 'CRITERIA' in FINDFIRST

4. Can't .FINDFIRST a GUID???

5. FindFirst with apostrophe'

6. Why my recordset.FindFirst can't work??

7. Findfirst's criteria string with single quote synax error

8. FindFirst when string contains '

9. FindFirst won't work under NT?

10. Help - Move to VB4, Now FindFirst doesn't work

11. Help - Move to VB4, Now FindFirst doesn't work

12. HELP ME. Findfirst doesn't work.

 

 
Powered by phpBB® Forum Software