by Ross Mack - GUI Computing
I recently had to work on a huge Access database that performed a massive import of around forty-five megabytes of unindexed dBase files. Because of the sheer volume of data - and the time the import took to run - it had only been run once when I took over maintenance. This meant, that after several days of updates to the Access Basic macros and queries, we discovered a design fault. Much of the data manipulation performed during the import relied on tables with counter fields. Spot the obvious problem. When the tables were cleared so that the import could be run again, their counter fields were no longer starting at zero. This caused a synchronisation problem and all the data immediately looked like it had come from another planet.
Now, I told you all that so I could tell you this. The best available solution seemed to be to find some way to reset the counters. Resetting counter fields is fiddly at best. You could create another database and import the structure of the existing database into it. In this case that would have meant importing not only 60-70 tables, but about 100 queries and 50 or so macros. Also, this is not really possible within the scope of an Access macro. What I decided to do was write some Access Basic code to destroy and recreate each table.
This is done in five stages: