Sorry me Hans, but changed my pd and lost all youy preciuos suggestion!
How to inser or update recordset where the value in question have apostroph?...
i remember only to replace a var with:
my_var=replcae(my_var,???????????)
example my_var="d'amico"
tks as usual.
LOST you suggestion to escape erro with apostroph in insert
-
- PlatinumLounger
- Posts: 4363
- Joined: 26 Apr 2010, 17:36
-
- Administrator
- Posts: 78547
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: LOST you suggestion to escape erro with apostroph in ins
Depends on how you're going to use it.
Best wishes,
Hans
Hans
-
- PlatinumLounger
- Posts: 4363
- Joined: 26 Apr 2010, 17:36
Re: LOST you suggestion to escape erro with apostroph in ins
Here si a difference in insert or update query?HansV wrote:Depends on how you're going to use it.
-
- Administrator
- Posts: 78547
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: LOST you suggestion to escape erro with apostroph in ins
If you create an SQL string in VBA with apostrophes / single quotes around text values, you need to replace apostrophes within those text values with two apostrophes:
Code: Select all
my_var=replace(my_var,"'", "''")
Best wishes,
Hans
Hans
-
- PlatinumLounger
- Posts: 4363
- Joined: 26 Apr 2010, 17:36
Re: LOST you suggestion to escape erro with apostroph in ins
Sorry to reply in old post...HansV wrote:If you create an SQL string in VBA with apostrophes / single quotes around text values, you need to replace apostrophes within those text values with two apostrophes:
Code: Select all
my_var=replace(my_var,"'", "''")
but,
now have my_var=valle d'aosta
I use the tips in question when i see the record in field i have:
valle d''aosta.!!!!!!!!!!!!!!!
note:
Ths field is in txt format
Last edited by sal21 on 17 Jan 2011, 15:16, edited 2 times in total.
-
- Administrator
- Posts: 78547
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: LOST you suggestion to escape erro with apostroph in ins
Please post the SQL you're using.
Best wishes,
Hans
Hans
-
- PlatinumLounger
- Posts: 4363
- Joined: 26 Apr 2010, 17:36
Re: LOST you suggestion to escape erro with apostroph in ins
resolved my self.. tks in other case.HansV wrote:Please post the SQL you're using.