Occasionally I have to write a program that uses a field to keep track of the last counter value used to create an invoice number, key field value, etc. As I loop through a recordset and generate the next value, I always update the field stored in a sql table each time I increment it.
Is it better to update a variable as I loop through a recordset or whatever, then update the database field at the end of the process? I never felt comfortable doing that.
I’m converting an Access application to VB keeping the Access tables. It is really slow as it is and sometimes takes hours to run. Am I reducing overhead much if I update the counter field at the end rather than as I go?