Delete quote

5 posts / 0 new
Last post
BENOIT
Offline
Joined: 11/29/2018 - 11:25
Delete quote

I have in my database a caracter's field wich contains sometines quotes.
exemple : JOURNAL DES "A NOUVEAUX"
I'm trying to replace or delate quote " by the following function but it doesn't work :
    Set db = Client.OpenDatabase(DBNAME)
    Set task = db.TableManagement
    Set field = db.TableDef.NewField
    field.Name = "JOURLIB2"
    field.Description = ""
    field.Type = WI_VIRT_CHAR
    a= "@Replace(JOURNALLIB;" & Chr(34) & Chr(34) & Chr(34) & ";"" "")"
    field.Equation = a
    field.Length = 100
    task.AppendField field
    task.PerformTask
    Set task = Nothing
    Set db = Nothing
    Set field = Nothing
I tried the function @remove but I didn't succeed to handle the quote.
anybody has an idea ?
Thanks

Brian Element's picture
Brian Element
Offline
Joined: 07/11/2012 - 19:57

Hi Benoit,

Try the following as your equation so replace the:

a= "@Replace(JOURNALLIB;" & Chr(34) & Chr(34) & Chr(34) & ";"" "")"

with

a = "@Replace(REMOVE_FIELD; @chr(34), """")"

the @char(34) in the equation returns the double quotes.

Brian

 

Brian Element's picture
Brian Element
Offline
Joined: 07/11/2012 - 19:57

You can also use:

a = "@Remove(REMOVE_FIELD, @chr(34))"

BENOIT
Offline
Joined: 11/29/2018 - 11:25

One more time, thank you Brian !

Brian Element's picture
Brian Element
Offline
Joined: 07/11/2012 - 19:57

No problem, glad to help.