Unfortunately, the company where I work has a lot of stuff stored and working in Microsoft Access. This includes both data tables, as well as the front-end interface for these database "systems."
And, unfortunately, I have been instructed to maintain/repair/enhance some of these Access databases.
In one particular database, I have implemented a lot of error-handling code, as well as seperating the front-end and back-end to two seperate databases. Also, I have a file that downloads the front-end of the database to each user's local PC, while the data all resides in a different Access DB on the network file server.
It's working very well like this - this database went from being corrupted about once every hour with only 3-4 users, to now being used by 10-15+ users and has yet to corrupt in over 2 months.
However, last night there was one corruption problem, and, as the database is now being widely-used throughout the organization, there was a lot of "heck" raised about it.
What I intend to do is write some code that will automatically repair and compact the backend database from the user's side if it happens to be corrupted.
The only problem is that I need a corrupted database to use as my testing sample!
Does anyone know how I can intentionally corrupt a database so that I can use it to test some code and see if I can get the events to line up properly?
Right now I'm assuming that I can somehow put an On Error whenever the database opens so that it will check for error 2239 (database is not a database file or needs repaired - which is the error that it returns if/when this happens), and then repair/compact the database if it does indeed return the error. My only problem is that I need to figure out where to place the event or error functioning, and I need a sample corrupt database to test this out!
I've been trying to throw the DB into endless loops and then killing the CPU process while the program is running. After a few different methods I can't seem to place how to corrupt a database intentionally! Can anyone who HAS done this before possibly give me some direction as to how you corrupted a database?
And, unfortunately, I have been instructed to maintain/repair/enhance some of these Access databases.
In one particular database, I have implemented a lot of error-handling code, as well as seperating the front-end and back-end to two seperate databases. Also, I have a file that downloads the front-end of the database to each user's local PC, while the data all resides in a different Access DB on the network file server.
It's working very well like this - this database went from being corrupted about once every hour with only 3-4 users, to now being used by 10-15+ users and has yet to corrupt in over 2 months.
However, last night there was one corruption problem, and, as the database is now being widely-used throughout the organization, there was a lot of "heck" raised about it.
What I intend to do is write some code that will automatically repair and compact the backend database from the user's side if it happens to be corrupted.
The only problem is that I need a corrupted database to use as my testing sample!
Right now I'm assuming that I can somehow put an On Error whenever the database opens so that it will check for error 2239 (database is not a database file or needs repaired - which is the error that it returns if/when this happens), and then repair/compact the database if it does indeed return the error. My only problem is that I need to figure out where to place the event or error functioning, and I need a sample corrupt database to test this out!
I've been trying to throw the DB into endless loops and then killing the CPU process while the program is running. After a few different methods I can't seem to place how to corrupt a database intentionally! Can anyone who HAS done this before possibly give me some direction as to how you corrupted a database?