Anyone know how to intentionally corrupt a MS Access Database?

joshg

Golden Member
Jul 3, 2001
1,359
0
0
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! :D 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? :D
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
Get a hand full of people to insert data simultaneously, or run multiple copies of Access (if it'll let you do that).

Why not consider moving the data to a real database backend? You can install MySQL or PostgreSQL for free and they work on Win32, the front end can still be done in Access via ODBC.
 

Smilin

Diamond Member
Mar 4, 2002
7,357
0
0

hehe yeah, open that sucker in notepad and type your name in the middle of it.
 

joinT

Lifer
Jan 19, 2001
11,172
0
0
Originally posted by: Smilin
hehe yeah, open that sucker in notepad and type your name in the middle of it.

ROFL. Considering how often it happens here at work - it can't be that difficult ;)

 

joshg

Golden Member
Jul 3, 2001
1,359
0
0
Why not consider moving the data to a real database backend? You can install MySQL or PostgreSQL for free and they work on Win32, the front end can still be done in Access via ODBC.

You know, I'd love to use a real DB backend.

This is quite a big company, however, with all sorts of administrative procedures, etc., to take place on all of this type of stuff.

They have both Oracle and DB2 servers here. However, getting a few tables set up on either system practically takes an act of congress around here, therefor the tables for these smaller applications will almost exclusively stay in MS Access (as designated by the entire IT department and directors of the other departments who own the data in question).

So, like I said, with a lot of this stuff I'm stuck with using MS Access as the backend.

In previous jobs where I had the freedom to do so, I would have definitely used a "real" database system for almost anything with any importance :D However, that is not the case here.



Oh, by the way ... typing your name into the file with notepad? Haha, I'll have to try that one! :D :p

I'm not exactly sure what will come of it .. but we'll see, right? :)

Thanks for all of the responses. :)
 

Shazam

Golden Member
Dec 15, 1999
1,136
1
0
If you're going to do that, don't use your name... Use the name of someone you don't like :)
 

Juniper

Platinum Member
Nov 7, 2001
2,025
1
0
make a copy first. have people connect to the database, shut down computer.
 

TheDiggler

Senior member
Dec 23, 2002
695
0
0
And as an added bonus, when you shut down the system, you get to test a CORRUPTED SYSTEM!!! :D
 

Jeshwin

Junior Member
May 16, 2013
2
0
0
Opened an ms access database in notepad and typed my manger name and it saved me 2day..thanks u guys:p
 

xSauronx

Lifer
Jul 14, 2000
19,582
4
81
You know, I'd love to use a real DB backend.

This is quite a big company, however, with all sorts of administrative procedures, etc., to take place on all of this type of stuff.

They have both Oracle and DB2 servers here. However, getting a few tables set up on either system practically takes an act of congress around here, therefor the tables for these smaller applications will almost exclusively stay in MS Access (as designated by the entire IT department and directors of the other departments who own the data in question).

So, like I said, with a lot of this stuff I'm stuck with using MS Access as the backend.

i interned with IT in a regional medical system. thousands of access databases were around that people or departments had used to do x, y and z. access 2000 databases, that is. IT never wanted to rock the boat and upgraded access for fear of not having enough resources to deal with the user issues that may have come up, and the DB wont take any responsibility for them since they are not SQL.

its...a bad, bad thing.
 

semnaitik

Junior Member
Oct 9, 2015
11
0
6
www.semnaitik.com
Why do you want to corrupt Access database? Anyway, before you can corrupt Access database, make sure you take its backup. You can try Hex Editor for this. Open the Access database on Hex Editor, you can remove some part of the file, either from header or footer. Also, you can overwrite the file.
Blog redacted
 
Last edited by a moderator: