Although the wiki says that TDbf supports AutoInc fields, it really doesn't. I have to fill them myself. And the app that is going to use that database expects specific values across multiple tables (in the code the AutoInc fields are changed to Integer, so they can be inserted).
So, I make a counter and fill them with the correct value. But the current AutoInc value is stored in the table and has to be changed to the correct maximum value, so the next record is inserted with the correct number.
It's just a bunch of (mostly text) files. It's not a database server where referential integrity and AutoInc values are automagically enforced.