Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Inserting values containing single quotes...

Re: Inserting values containing single quotes...

From: Joerg Leute <leute_at_itdesign.de>
Date: Sun, 27 Jun 1999 13:19:12 +0200
Message-ID: <7l5198$10t9$1@news.lf.net>


Hi Dave

use replace to replace a single quote with 2 single quotes, which works

dim strInsert as String
strInsert = "My'Test"
INSERT INTO TEST Name Values('" & strInsert & "') doesn't work

but if you do it like this

INSERT INTO TEST Name Values('" & replace(strInsert,"'","''") & "')

It works...

Greetins

Joerg

Dave Carr > schrieb in Nachricht <01bec009$2d93eb60$9415010a_at_fdcmes01wp>...
>How (within VB6/ADO) do you insert or update columns with data that
>contains
>single quotes?
>
>I thought I just add a single quote whenever one is found in a string...
>which works
>in the SQL window but not in code...
>
>TIA,
>-Dave
>dcarr<at>gr<dot>com
Received on Sun Jun 27 1999 - 06:19:12 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US