Thanks I figured it out just after posting. I was using Api.TryOpenTable. and not closing the JET_TABLEID after. I have replaced it with the Table wrapper.
using (var table = new Table(currentSession, dbid, "messages", OpenTableGrbit.None))
I have a somewhat related question. This showed up in a piece of code where I get all records from one table and then as I read each record I open another table and get the related records in that table. I have tried the approach of opening and closing
the table each time I go through the loop and I have tried opening the table once and repositioning the cursor each time.
Is there any prefered way to do this?