Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Inserting values containing single quotes...
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
![]() |
![]() |