I’m trying to make changes in the database using RowSet.Editrow. Connection Ok., Querying data is OK. But changing it using the following code is not possible. Nothing happens. No error
var rs as RowSet
rs = SQLiteDatabase1.SelectSQL(“SELECT f1, f2 from t1 where f1 = ‘test1’;” )
to use editrow, you must have a primary key in the table, and you must select this primary key in your query.
you can also use a sqlexecute and use the sql UPDATE command.
It’s possibly because you are modifying the primary key.
You could try using a column alias to retrieve a second copy of the column which you then modify.
Something like this…
var rs as RowSet
rs = SQLiteDatabase1.SelectSQL("SELECT f1, f1 AS f1b, f2 from t1 where f1 = 'test1';")
rs.EditRow
rs.Column("f1b").StringValue = "test2"
rs.SaveRow
rs.Close