SQLiteDatabase.edit

It seems that if I use a SQLitedatabase object, the edit and update methots do not work. If I use the same code but creating the db as realsqldatabase they works correctly.
Am I doing something wrong?

My code:

      rs.Edit
      rs.Field("creationdate").DateValue=TodayDate 'as date
      rs.Field("daysofuse").IntegerValue=DaysComputed
      rs.Update
      db.Commit

How you reached the current record? Does your SELECT contains the primary key field?

Have you defined a PrimaryKey?

I add this info: the primary key MUST be present in the recordset as field, otherwise the editing is not possible.

So…

rs=db.sqlexecute(“select abc from xyz where id=‘2’”)
rs.edit
rs.idxfield(1).stringvalue=“HELLO”
rs.update
db.commit

doesn’t edit the record… but

rs=db.sqlexecute(“select abc,id from xyz where id=‘2’”)
rs.edit
rs.idxfield(1).stringvalue=“HELLO”
rs.update
db.commit

it works fine!

Thanks for your help!

Dim R As RecordSet

R=SQLFile.SQLSelect(“SELECT * FROM A WHERE T01= '”+ListBox1.Text+"’")

If R <> Nil And R.RecordCount > 0 Then
R.Edit

If K=1 Then
  R.Field("T13").StringValue= "LOVE"
  R.Update
Else
  R.Field("T13").StringValue = ""
  R.Update
End If

IF NOT SQLFile.Error Then
  SQLFile.Commit
Else
  dbERROR(SQLFile.ErrorCode)
  Return
End If

My this also can’t work, I am 2015r2.2, please help me