From: Geoff Chambers on
I am transfering data from one database to another in my application.
I am running into problems when I pass the string with the parameters.
I take the value Some Text I have to surround it like so 'Some
Text'. No problem unless it is SomeText's then it looks like 'Some
Text's'. Which you see can be a problem. Can I use another delimiator
like [Some Text's]?

Is there a function that will parse out the ['] from my string?

Geoff
From: Geoff Schaller on
Geoff.

From what to what?

You could easily do a StrTran() - pick something ridiculous like a '|'
or a '}}'.

If it is for SQL, SQL does this automatically by doubling the quote. If
it is for DBF then you just use the above or also double the quote. That
is the conventional mechanism. If it is for a CSV then my CSV generator
allows you to specify field and row separators.

Geoff



"Geoff Chambers" <gchambers02(a)msn.com> wrote in message
news:f9320d6f-cee3-45d5-8913-c3cb233b8e67(a)i76g2000hsf.googlegroups.com:

> I am transfering data from one database to another in my application.
> I am running into problems when I pass the string with the parameters.
> I take the value Some Text I have to surround it like so 'Some
> Text'. No problem unless it is SomeText's then it looks like 'Some
> Text's'. Which you see can be a problem. Can I use another delimiator
> like [Some Text's]?
>
> Is there a function that will parse out the ['] from my string?
>
> Geoff

From: Carlos Rocha on
Not that I know. Maybe you can parse the string, break it if you find a
delimiter, and replace it with the equivalent _chr() ?
If it's a SQL statement you can try to double the delimiter. It's kind
of standard

Geoff Chambers escreveu:
> I am transfering data from one database to another in my application.
> I am running into problems when I pass the string with the parameters.
> I take the value Some Text I have to surround it like so 'Some
> Text'. No problem unless it is SomeText's then it looks like 'Some
> Text's'. Which you see can be a problem. Can I use another delimiator
> like [Some Text's]?
>
> Is there a function that will parse out the ['] from my string?
>
> Geoff
>
From: Malcolm on
Geoff Chambers wrote:
>
> I am transfering data from one database to another in my application.
> I am running into problems when I pass the string with the parameters.
> I take the value Some Text I have to surround it like so 'Some
> Text'. No problem unless it is SomeText's then it looks like 'Some
> Text's'. Which you see can be a problem. Can I use another delimiator
> like [Some Text's]?
>
> Is there a function that will parse out the ['] from my string?

Every SQL I have used you double the '
so "'"+strtran("SomeText's","'","''")+"'"
then again I usually try and use bound parameters to avoid this.