Hi,
I don't understand this: Some insert statements work, some don't. And I get no error messaage, nothing.
How can this be?
I don't understand this: Some insert statements work, some don't. And I get no error messaage, nothing.
How can this be?
B4X:
Dim SQL1 As SQL
...
Dim tg As TGetContacts
Dim ContactList As List
ContactList.Initialize
ContactList.AddAll(tg.GetAllContacts)
...
For iz=0 To ContactList.size-1
s=ContactList.Get (iz)
i = s.IndexOf(CRLF)
DoEvents
na = addslashes (s.SubString2(0, i))
nu = addslashes (s.SubString(i + 1))
nu=nu.Replace (" ","")
nu=nu.Replace ("-","")
nu=nu.Replace ("/","")
nu=nu.Replace ("#","")
nu=nu.Replace ("*","")
s = "select AID from contacts where number='" & nu & "'"
Log (s)
If Main.SQL1.ExecQuerySingleResult (s)=Null Then
s="insert into contacts values (Null,'" & na & "','" & nu & "',0,0,'" & jetz & "')"
Log (s)
Main.sql1.ExecNonQuery (s)
' sometimes this works, sometimes not
End If
Next