I want to add a field to my TSqlite3Dataset table, and keeping all the records already in the table.
"levels" is the name of my TSqlite3Dataset.
levels.FieldDefs.Add('scr_diffels', ftInteger, 0);
levels.FieldDefs.Update;
levels.RefetchData;// i've tried without this as well, no difference
After the above code, I go through all the records (using level.First and while not levels.EOF do...)
levels.Edit;
levels.FieldByName('scr_diffels').AsInteger:=64;
levels.UpdateRecord;
But the field 'scr_diffels' does not exist.
I've also tried adding the field using levels.Fields.Add, but that didn't work because I couldn't set the "DataType" property of the field. And I wonder if it would work using that anyway...
So how to add a field to a table and keeping all the current data in the table?