Skip to main content

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 Tue, 04/02/2019 - 12:42

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

 

The website encountered an unexpected error. Try again later.