Then i build a little example to isolate the problem, here it is:
Code: Select all
Procedure UpdateTable(Element.s,Content.s,index.s)
TableString.s = "UPDATE test SET " + Element + "='" + Content + "' WHERE id LIKE '" + index + "'"
Result = SQLiteExec(TableString)
Debug TableString
Debug "INSERT result = "+Str(Result)+" - "+SQLiteError(Result)
ProcedureReturn 1
EndProcedure
If InitSQLite()
DeleteFile("testing.db")
DBName$ = "testing.db"
DBHandle = SQLiteOpen(DBName$)
If DBHandle
;Create Database
Result = SQLiteExec("CREATE TABLE test (id INTEGER PRIMARY KEY unique, element1, element2, element3)")
Debug "CREATE result = "+Str(Result)+" - "+SQLiteError(Result)
Result = SQLiteExec("INSERT INTO test VALUES(null, 'a', 'b', 'c')")
Debug "INSERT result = "+Str(Result)+" - "+SQLiteError(Result)
Result = SQLiteExec("INSERT INTO test VALUES(null, 'a', 'b', 'c')")
Debug "INSERT result = "+Str(Result)+" - "+SQLiteError(Result)
TableString.s = "UPDATE test SET element3='new content3' WHERE id LIKE '1'"
Result = SQLiteExec(TableString)
Debug "INSERT result = "+Str(Result)+" - "+SQLiteError(Result)
TableString.s = "UPDATE test SET element2='new content2' WHERE id LIKE '1'"
Result = SQLiteExec(TableString)
Debug "INSERT result = "+Str(Result)+" - "+SQLiteError(Result)
TableString.s = "UPDATE test SET element1='new content1' WHERE id LIKE '1'"
Result = SQLiteExec(TableString)
Debug "INSERT result = "+Str(Result)+" - "+SQLiteError(Result)
Result = SQLiteGetTable("SELECT id, element1, element2, element3 FROM test WHERE id LIKE '%'")
Debug ""
Debug "Fist UPDATES:"
Debug SQLiteField(1, "element1")
Debug SQLiteField(1, "element2")
Debug SQLiteField(1, "element3")
Debug ""
If UpdateTable("element1","more new content 1","1")
If UpdateTable("element2","more new content 2","2")
If UpdateTable("element3","more new content 3","3")
Result = SQLiteGetTable("SELECT id, element1, element2, element3 FROM test WHERE id LIKE '%'")
Debug ""
Debug "Second UPDATES:"
Debug SQLiteField(1, "element1")
Debug SQLiteField(1, "element2")
Debug SQLiteField(1, "element3")
EndIf
EndIf
EndIf
EndIf
SQLiteClose()
EndIf
End
Thanks in advance for any help

