Reduce97.mdb (advanced) |
Post Reply |
Author | |
Roger Carlson
Microsoft MVP Joined: 20 Feb 2008 Status: Offline Points: 261 |
Post Options
Thanks(0)
Posted: 28 Jul 2008 at 8:04am |
Please consider donating $1 per sample downloaded, find out why here.
Reduce97.mdb This was originally designed as a way to delete large amounts of data from very large databases using DAO.
The problem with using a delete query is that it tries to save all the deleted records in memory just so it can ask you if you are really sure at the end. I also needed a way to break into the delete without un-deleting the already deleted records (something else the delete query does not allow). I needed to delete hundreds of thousands of records, and delete queries were not working.
These functions delete the records through VBA. They open a recordset, move to the first record, delete it, and move to the next, and so on. The Simple form just selects records to delete based on only one date. The Advanced form allows you choose a range of dates and also exclude time ranges when the process will not work. By default, it will cancel execution at midnight. Both forms allow you to break into the delete without un-deleting records. Once they are deleted, they are deleted for good. There is no recovery. That being the case, you should probably back up the table, so you have good data to work with. Click the button below to back up the table. NOTE: there are better ways to do this, in most cases. This is a very early sample and one I never converted to Access 2000. However, I think it has some interesting features and is a good learning tool for DAO programming. Download |
|
|
|
Sponsored Links | Want a good read? Try The Summer of His Life (available on Amazon!) |
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |