Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Apostrophie Problem
Perry Hemmings wrote:
>
> Hello All
>
> I am running Oracle 8 with a Visual Basic frontend, my program falls over
> when an Apostrophe is in the name i.e. O'Brien and my search needs adjusting
> can anyone advise me on how to achieve this??
>
> Res = "SELECT Lastname FROM Customer WHERE Lastname = txtTEXTBOX"
I don't know if that works in VB....but why not:
you have to use 'bind-variables'
it will work similar like this
Stmt = "SELECT Lastname FROM Customer WHERE Lastname = :the_name"
where :the_name is the bind-variable (notice the colon in front of the variable)
Now you can bind a valye to the bind-variable. The value now can also
contain
an apostrophe.
For further information on that topic read your manual.
Regards, Stephan Received on Thu Jan 18 2001 - 01:49:57 CST