Dear Mark,
I would suggest you to review mod_harbour\samples\genesis as a starting point:
https://github.com/FiveTechSoft/mod_harbour/tree/master/samples/genesis
You can manage online all the tables that you may need and it uses generic code that you can easily reuse