ExecNonQuery2 error if the ' character is included in string

Pappsegull

Member
Licensed User
Longtime User
I run a loop to insert data, it works well until I come to a name that have the ' character in it ( i.e. in Tongan Pa'anga).

I have try: sA(0).Replace("'", "ʻ") , but the ' will not be replaced.

sA() is a String array

B4X:
s = "?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?"
[COLOR="Blue"]For[/COLOR] x = 0 [COLOR="Blue"]to[/COLOR] y
    sA(0) = R(x).Name: sA(0).Replace("'", "ʻ") 
    sA(1) = R(x).Code: sA(2) = R(x).Info

    [COLOR="Green"]'More field to fill here...[/COLOR]

    DB.ExecNonQuery2("INSERT INTO Table VALUES(" & s &)", sA)
[COLOR="Blue"]Next[/COLOR]

Any idea?

/Thanks
 

Pappsegull

Member
Licensed User
Longtime User
String.Replace() don't work at all

Thanks Dude

Sorry but String.Replace() don't work at all

txt = txt.Replace(Target As String, Replacement As String)

I have try all kind of chracters but nothing get replaced:BangHead:

i.e.

B4X:
[COLOR="Blue"]Dim[/COLOR] s As [COLOR="Plum"]String[/COLOR]: s = "hello"
      
    s.Replace("e", "o")
    [COLOR="Green"]' s = "hello" here[/COLOR]

Anyone any other ideas? Bug?

Thanks!
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…