Base Macro to update a field in table

Hi, I am stuck on what I assume is something obvious, I’m not that familiar with Base so apologies. I am working on a Corporate db so can’t show the code, so have a made up db for this example.

The DB is “DB1”, with a table “tblTable1” which has two fields “A” and “B” both integers, “A” has values in it and “B” is empty, there is no primary key! What I’m trying to do is write a macro that steps through each record in turn, reads in the value of “A”, does some clever maths! In this case just adds two, then updates the “B” field in that record with the answer, then moves to the next record etc etc.

I have done most of the code which seems to work until I try to update “B” then I get an error about the table being Read Only, which I can’t get around. I haven’t included any code as I’m interested to see what someone who knows what they are doing would do.

Any help greatly appreciated.

Are you using Base embedded database? You can’t enter data in a table unless it has a primary key. How did you get data into field “A”?

EDITED 7/2

If when creating a Table you do not set a primary key you will get an error when saving the Table stating that a primary key has not been created and that data can’t be entered. Did you not get this error when you created a Table without a primary key and saved it?

Good questions: Database is Firebird embedded. In this example I entered some 9 or 10 rows of data manually into “A” in the real db the data comes from monitoring software directly. At the moment there is no primary key in either db, that may change later.