Hi Rimma,
That code should work as I do something similar. I have this custom method in a
class:
     public static String escapeApostophe(String theString)
     {
          String theNewString = CSpUtil.replaceSubstringAll (theString, "'",
"''");
          return (theNewString);
     }

To use it, I call it like this:
     escapeApostophe(getDisplayFieldValue("TbSpousNm").stringValue().trim())

Janet



                                                                  
 (Embedded                                                        
 image moved   "Rimma" <[EMAIL PROTECTED]>                      
 to file:      08/04/99 09:58 AM                                  
 pic25622.pcx)                                                    
                                                                  



Please respond to "Rimma" <[EMAIL PROTECTED]>

To:   [EMAIL PROTECTED]
cc:    (bcc: Janet Traub/IS/SSC/THD)
Subject:  [ND] Filtering the values sent to the database...





Hello,

what is the easy way to filter the values that I'm sending to the database?

I'm using the MS Access database and when a user enters the text in the textbox
that
contains " ' ", the text doesn't get inserted.  So I would like to replace the "
' " with " " ".
Here's the code that I have right now:

String articleText = getDisplayFieldValue("dfArticleText").stringValue().trim();
new CSpString(CSpUtil.replaceSubstring(articleText.toString(),"'","''"));

However, this doesn't work.  Does anybody know what's wrong or how can
I do it better?
Thanks,
Rimma
_________________________________________________________________________

For help in using, subscribing, and unsubscribing to the discussion
forums, please go to: http://www.netdynamics.com/support/visitdevfor.html

For dire need help, email: [EMAIL PROTECTED]

pic25622.pcx

Reply via email to